校招刷题群
高效刷题 迎战校招
校招精选试题
近年面笔经面经群内分享
Java刷题群 前端刷题群 产品运营群
首页 > js语言和框架 > 基本语法-if\show
题目

Vue的路由的传参方式正确的有()

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 }})


C 1条回复 评论
紫侠仙子

大厂陆续开放校招了要抓紧时间

发表于 2023-03-06 22:00:00
0 0