1、跳转用法

@1、在template模板中通常使用router-link to='url'

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

@2、在js中

1、this.$router.push({path: ''/order/index''});
2、this.$router.push({path: '/order/page1',query:{ id:'2'}});
3、this.$router.push({name: '/order/page2',params:{ id:'6'}});

第一种不传参直接跳转到某一个页面,第二种,第三种传参跳转到某个页面,第二种和第三种不同的是都传了参数过去,第二种参数在url中显示第三种不显示



扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄