vue动态路由参数
1. vue路径中可以放置一些参数routes: [{path: '/course/detail/:id/',// 通过this.$route.params.id 进行获取name: 'CourseDetail',component: CourseDetail},]2. 取值(取出路由中放置的id)this.$route.params.id3. html路由写法<router-link to
·
1. vue路径中可以放置一些参数
routes: [
{
path: '/course/detail/:id/', // 通过this.$route.params.id 进行获取
name: 'CourseDetail',
component: CourseDetail
},
]
2. 取值(取出路由中放置的id)
this.$route.params.id
3. html路由写法
<router-link to="/course/detail/2/">今年初撒</router-link>
更多推荐
已为社区贡献22条内容
所有评论(0)