Imagine I've set up a route like this:
import Vue from "vue";
import Router from " vue-router";
import BookRoutes from "./routes/book";
Vue.use(Router)
const router = new Router({
routes:[
{
path: "/book",
name: "book",
component:{
render(c) {
return c("router-view")
}
},
childern: BookRoutes
}
]
})
And in the 'book' route, there is an index.js file:
const BookProfile = () =>
import (/* webpackChunkNames: "BookProfile" */ "@/components/profile/book/BookProfile")
import BookRoutes from "./Book";
export default [{path:
"book/:bookId",
"name": "profile.book",
redirect: {name: "profile.book.fee"},
component: BookProfile,
children: BookRoutes
}]
Inside Book.js:
const BookFee = () => import (/* webpackChunkName: "BookProfilr" */)
export default:[{
path: "book-fee",
name: "profile.book.fee",
component: BookFee
}]
I've created several similar routes. How can I retrieve a list of all routes, ideally with their IDs populated, but if not, just a list of all the routes created in a Vue project.
If you need more information, please feel free to ask.