vue-router跳转页面的两种方式(声明式导航和编程式导航)
声明式导航指通过链接进行页面跳转,编程式导航通过this.$router.push,back,go进行页面跳转
1.通过path地址
(1)query传参:/path?key1=value&key2=val2...
this.$router.push(`/detail/${this.msg}/dfdf`)
(2)params传参:/path/${this.msg}/dfdf
this.$router.push(`/detail/${this.msg}/dfdf`)
2. 通过路由name跳转
this.$router.push({name:'news '})