Nuxt/playground/pages/index.vue

29 lines
569 B
Vue
Raw Normal View History

2021-03-18 14:26:41 +00:00
<template>
<div>
<h2>
Hello world
</h2>
<strong>Playground pages</strong>
<ul>
<li v-for="link of links" :key="link">
<nuxt-link :to="link">
{{ link }}
</nuxt-link>
</li>
</ul>
2021-03-18 14:26:41 +00:00
</div>
</template>
<script>
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'
export default defineComponent({
setup () {
const links = useRouter().getRoutes().filter(route => ['index', '404'].includes(route.name) === false).map(route => route.path)
return { links }
}
})
</script>