diff --git a/examples/Header.vue b/examples/Header.vue index 559fb4d4..cfcf1302 100644 --- a/examples/Header.vue +++ b/examples/Header.vue @@ -4,17 +4,26 @@ import { routes } from './router' const router = useRouter() const route = useRoute() -const onChange = (event: any) => { - router.push(event.target.value) +const onChange = (event: Event) => { + router.push((event.target as HTMLSelectElement).value) } + +const computedRoutes = computed(() => { + return routes + .filter((r) => r.path !== '/') + .map((r) => ({ + path: r.path, + label: r.path.substring(1), + })) +})