直播软件搭建,vue路由跳转的四种方式
直播软件搭建,vue路由跳转的四种方式
1.不带参数
<router-link :to="{name:'home'}">
<router-link :to="{path:'/home'}">
2.带参数
<router-link :to="{name:'home', params: {id:1}}">
this.$router.push() (函数里面调用)
3.不带参数
this.$router.push({name: 'home'})
this.$router.push({path: '/home'})
4.query传参和params传参
this.$router.push({path: 'home', query:{id:'1'}})
this.$router.push({name: '/home', params: {id:'1'}})
以上就是直播软件搭建,vue路由跳转的四种方式, 更多内容欢迎关注之后的文章