From bb30db7c08708672e7981736c505a1f27ea3a688 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 22 Apr 2022 15:02:34 +0200 Subject: [PATCH] examples: add initial class to basic --- examples/Header.vue | 19 ++++++++++++++----- examples/src/Basic/Basic.vue | 9 +++++---- examples/src/Basic/BasicOptionsAPI.vue | 8 ++++---- 3 files changed, 23 insertions(+), 13 deletions(-) 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), + })) +})