chore: improve syntax
This commit is contained in:
+3
-1
@@ -15,7 +15,9 @@ export default {
|
|||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
const urlParams = new URLSearchParams(window.location.href.split('?')[1])
|
const urlParams = new URLSearchParams(window.location.href.split('?')[1])
|
||||||
const theme = urlParams.get('theme') && urlParams.get('theme').match(/^[A-Za-z0-9\s]+/)[0]
|
const theme =
|
||||||
|
urlParams.get('theme') &&
|
||||||
|
urlParams.get('theme').match(/^[A-Za-z0-9\s]+/)[0]
|
||||||
if (theme) {
|
if (theme) {
|
||||||
setColorMode(theme)
|
setColorMode(theme)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user