使用 this.$router.push(location) 來修改 url,完成跳轉
push 后面可以是對象,也可以是字符串:
1 // 字符串 2 this.$router.push('/home/first') 3 // 對象 4 this.$router.push({ path: '/home/first' }) 5 // 命名的路由 6 this.$router.push({ name: 'home', params: { userId: wise }})
例如:
1 // 點擊事件里面寫 2 this.$router.push({ name: 'distributesList', query: { ruleForm: this.ruleForm }})