I have the following router.js with few dozens of value-x, i.e. value-one, value-2.
const router = new Router({
routes: [
{
path: "/plant/value-one",
name: "value-one",
components: {
default: Site
},
props: {
default: {
tab: 'value-one',
menu: 'value-one'
}
}
},
{
path: "/plant/value-two",
name: "value-two",
components: {
default: Site
},
props: {
default: {
tab: 'value-two',
menu: 'value-two'
}
}
}
]
}
)
I would like to turn it into something like this:
path: "/plant/*"
I tried the following:
const router = new Router({
routes: [
{
path: "/plant/{:name}",
name: name,
components: {
default: Site
},
props: {
default: {
tab: name,
menu: name
}
}
}
]
}
)
Name variable should also be passed to route's name as well as to tab and menu variables.
What am I missing here?
name? It doesn't appear to be defined