In Nuxt, routes are generated automatically, so I could not do what @zxzak suggested.
Here is what you can do in this case.
<template v-for="item in items"> <b-nav-item :to="item.path"> {{item.name}} </b-nav-item> </template>
export default { created() { this.$router.options.routes.forEach(route => { this.items.push({ name: route.name , path: route.path }) }) } , data() { return { items: [] } } }
Richard Ayotte
source share