在当前路由中有一个toArticle方法可以跳转到article页面
methods:{
toArticle:function(index) {
this.$router.push({path:'/article',params:this.blogList[index]});
}
}
在article中接受不到params
mounted(){
console.log(this.$route.params)
//这里输出undifined
}
导致这样的原因是因为params需要通过name来获取,这里就要明白query和params的区别了
que
- 1
- 2
前往页