chore: update examples header

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-05 18:39:48 +01:00
parent 05c615c00b
commit f3a6ab8417
+7 -5
View File
@@ -3,25 +3,27 @@ import { useRoute, useRouter } from 'vue-router'
import { routes } from './router'
const router = useRouter()
const route = useRoute()
const onChange = (event: Event) => {
router.push((event.target as HTMLSelectElement).value)
}
const computedRoutes = computed(() => {
return routes
const computedRoutes = computed(() =>
routes
.filter((r) => r.path !== '/')
.map((r) => ({
path: r.path,
label: r.path.substring(1),
}))
})
})),
)
</script>
<template>
<header>
<a class="logo" href="https://github.com/bcakmakoglu/vue-flow"> Vue Flow Dev </a>
<select v-model="route.path" @change="onChange">
<select :value="route.path" @change="onChange">
<template v-for="r of computedRoutes" :key="r.path">
<option :value="r.path">
{{ r.label }}