Reputation: 7338
How to pass attributes to vuecomponent in vue router?
const routes = [
{
path: "/dashboard/profile",
name: "DashboardProfile",
component: <DashboardProfile foobar="false"/>, // <--- How can I achieve this?
},
];
Upvotes: 1
Views: 116
Reputation: 1
You could pass a prop object like :
const routes = [
{
path: "/dashboard/profile",
name: "DashboardProfile",
component: DashboardProfile,
props:{show:false}
},
];
then inside your component use that prop for conditional rendering at the component root.
Upvotes: 3