vue2.0js + css 应用了解

this.$router.push({})实现路由跳转

2018-08-10  本文已影响10人  zlf_j

使用 this.$router.push(location) 来修改 url,完成跳转

push 后面可以是对象,也可以是字符串:

// 字符串
this.$router.push('/home/first')
// 对象
this.$router.push({ path: '/home/first' })
// 命名的路由
this.$router.push({ name: 'home', params: { userId: wise }})

例如:

// 点击事件里面写
this.$router.push({ name: 'distributesList', query: { ruleForm: this.ruleForm }})

参考:
http://www.cnblogs.com/wisewrong/p/6277262.html

上一篇 下一篇

猜你喜欢

热点阅读