diff --git a/src/components/Main.vue b/src/components/Main.vue index f5f0845..5684d6a 100644 --- a/src/components/Main.vue +++ b/src/components/Main.vue @@ -24,9 +24,13 @@ const activeWindow = ref(defaultWindow) const router = useRouter() const route = useRoute() + +const urlEncodeWindow = (label: string) => label.replace(' ', '-') + if (route.params.type) activeType.value = route.params.type as NavType if (route.params.window) { - activeWindow.value = windows.find((w) => w.label === route.params.window) || defaultWindow + console.log(route.params.window, windows) + activeWindow.value = windows.find((w) => urlEncodeWindow(w.label) === route.params.window) || defaultWindow } const updateRoute = () => { @@ -35,7 +39,7 @@ const updateRoute = () => { name: 'view', params: { type: activeType.value, - window: activeWindow.value?.label.replace(' ', '-') + window: urlEncodeWindow(activeWindow.value?.label) } } router.push(route)