Skip to content

Commit f3a6ab8

Browse files
committed
chore: update examples header
Signed-off-by: braks <[email protected]>
1 parent 05c615c commit f3a6ab8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/vite/Header.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,27 @@ import { useRoute, useRouter } from 'vue-router'
33
import { routes } from './router'
44
55
const router = useRouter()
6+
67
const route = useRoute()
8+
79
const onChange = (event: Event) => {
810
router.push((event.target as HTMLSelectElement).value)
911
}
1012
11-
const computedRoutes = computed(() => {
12-
return routes
13+
const computedRoutes = computed(() =>
14+
routes
1315
.filter((r) => r.path !== '/')
1416
.map((r) => ({
1517
path: r.path,
1618
label: r.path.substring(1),
17-
}))
18-
})
19+
})),
20+
)
1921
</script>
2022

2123
<template>
2224
<header>
2325
<a class="logo" href="https://github.com/bcakmakoglu/vue-flow"> Vue Flow Dev </a>
24-
<select v-model="route.path" @change="onChange">
26+
<select :value="route.path" @change="onChange">
2527
<template v-for="r of computedRoutes" :key="r.path">
2628
<option :value="r.path">
2729
{{ r.label }}

0 commit comments

Comments
 (0)