3π
β
Is it somewhere documented that you can use a function for component
?
Instead of a function you could use a getter:
import Mycomponent from '@/views/Mycomponent'
import MycomponentDifferent from '@/views/MycomponentDifferent'
{
name: 'My component name',
path: somepath,
get component() {
if(true) {
console.log(Mycomponent) // You can see in console whole component
return Mycomponent
} else {
return MycomponentDifferent
}
}
}
π€Crackers
Source:stackexchange.com