Commit 00158f25 authored by Kasper Seweryn's avatar Kasper Seweryn 🥞 Committed by Kasper Seweryn
Browse files

Cleanup updateQueryString composable

parent aef58e33
export default (uri: string, key: string, value: string) => {
const re = new RegExp(`([?&])${key}=.*?(&|$)`, 'i')
if (uri.match(re)) {
return uri.replace(re, `$1${key}=${value}$2`)
} else {
const separator = uri.indexOf('?') !== -1 ? '&' : '?'
return `${uri}${separator}${key}=${value}`
}
const url = new URL(uri)
url.searchParams.set(key, value)
return url.href
}
......@@ -21,8 +21,6 @@ const app = createApp({
components: {
App: () => import('~/App.vue')
},
setup () {
},
data: () => ({ isMounted: false }),
async mounted () {
this.isMounted = true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment