很简单,但需要将动态路由转化为props中的参数,看下面代码来理解:
···
{
path:"item/:name",
name: "item unit",
component: ItemUnit,
props: (route)=>{
return {
name: route.params.name,
type:"item"
}
}
},
···
接收端也简单
{
props:['name','type'],
}
很简单,但需要将动态路由转化为props中的参数,看下面代码来理解:
···
{
path:"item/:name",
name: "item unit",
component: ItemUnit,
props: (route)=>{
return {
name: route.params.name,
type:"item"
}
}
},
···
接收端也简单
{
props:['name','type'],
}