首页 > 软件开发 > vue > vue跳转

vue跳转

1
2
3
4
5
6
7
8
9
10
11
// 普通跳转
<router-link :to="{name:'forget_pass'}">忘记密码</router-link>
<el-button @click="router.push({path: '/'})">网站首页</el-button>
router.push({name:'search'})
this.$router.push({name:'search'})
 
// 跳转带参数
<router-link to="{path:'/', query:{name:'名称'}}">网站首页</router-link>
<el-button @click="router.push({path: '/', query:{name:'名称'}})">网站首页</el-button>
router.push({name:'search', query:{keyword: this.keyword}})
this.$router.push({name:'search', query:{keyword: this.keyword}})


猜你喜欢

0 条评论

img 登陆后才能评论哦~