router传递参数
今日发现另一种路由携带参数得写法
路由配置如下,重要的是:id 以及props:true
{
path: '/viewForm/:id',
name: 'viewForm',
props: true,
component: () => import('@/components/FormView.vue'),
}
路由跳转携带参数:
this.$router.push(`/viewForm/${row.id}`)
跳转组件直接使用props获取id,
原创
2021-03-10 16:51:04 ·
169 阅读 ·
0 评论