js语言和框架-vue.js-基本语法-if\show
面5笔5Vue的路由的传参方式正确的有()
A.this.$router.push({path:'',query:{}})
B.this.$route.push({path:'',params:{}})
C.this.$router.push({path:`/describe/${id}`})
D.this.$route.push({path:`/describe/${id}`})
正确答案是 C
重点:$router 注意后面有r
// 字符串
this.$router.push('/home/first')
// 对象
this.$router.push({ path: '/home/first' })
// 命名的路由
this.$router.push({ name: 'home', params: { userId: wise }})