<li v-for="(item, index) in menulist" :key="index">
<router-link :to="{path: 'websiteList',query:{oid:item.routemap}}">{{ item.cat_name }}
</router-link>
</li>
/websiteList 跳转页面
created() {
if (this.$route.query.oid) this.query.routemap = this.$route.query.oid
this.getbascat()
},
//监听当前路由变化
beforeRouteUpdate(to, from, next) {
this.query.routemap = to.query.oid
this.getbascat()
console.log(to.query.oid);
next()
},
//或者使用
watch:{
'$route'(to,from){
this.query.routemap = to.query.oid
this.getbascat()
}
},
跳转同一页面 传递参数不同 页面未刷新
最新推荐文章于 2023-11-28 13:58:11 发布