'$route.query.categoryId': function( ){
//只要categoryId的值发生变化,这个方法就会被调用
this. list. categoryId = this.$route.query.categoryId;
//重新调用请求数据的方法,刷新页面数据
this.findAllArticleById()
}
//用 watch 也可以
watch: {
$route(to, from) {
if (to.path == from.path) {
this.helpCenterSearchValue = to.query.key;
this.activeName = to.query.tab;
this.getHelpCenterList();
}else{
this.helpCenterSearchValue = "";
this.activeName = "";
}
}
},