I have a reusable component that only needs a different api call depending on the component everytime it's called.
I want to be able to do something like this
const routes = [
{
path: '/books',
component: () => import('./Pages/Book-highlights/Nav/index.js'),
props: {api: '/api/allBooks'}
}
]
const router = new VueRouter({
routes
})
As I understand it, the props is just to enable the use of URL slugs (or whatever they are called) ?api=something. I want to be able to do something like this
<Nav api='/api/allBooks'></Nav>
But of course, buy passing that api in the VueRouter
Everything I have researched tells me it can't be done but I feel like I have seen it somewhere!
idcomes from the URL/:idI need to provide thatidwithout replying on the url