Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
funkwhale
funkwhale
Commits
00158f25
Commit
00158f25
authored
Apr 23, 2022
by
Kasper Seweryn
🥞
Committed by
Kasper Seweryn
Jul 03, 2022
Browse files
Cleanup updateQueryString composable
parent
aef58e33
Changes
2
Hide whitespace changes
Inline
Side-by-side
front/src/composables/updateQueryString.ts
View file @
00158f25
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
}
front/src/main.ts
View file @
00158f25
...
...
@@ -21,8 +21,6 @@ const app = createApp({
components
:
{
App
:
()
=>
import
(
'
~/App.vue
'
)
},
setup
()
{
},
data
:
()
=>
({
isMounted
:
false
}),
async
mounted
()
{
this
.
isMounted
=
true
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment