<router-link :to="{path:'course/newcourses',query:{value:JSON.stringify(value)}}">
<span class="operation">详情</span>
</router-link>
跳转
//处理query传参页面刷新数据丢失问题
created() {
this.listcontent = JSON.parse(this.$route.query.value);
console.log(this.listcontent);
this.chapter();
this.getDataClass();
},
beforeRouteEnter(to, from, next) {
next(vm => {
// vm.targetUser = JSON.parse(to.params.user)
vm.targetUser = JSON.parse(to.query.user)
});
},
接收 beforeRouteEnter用来处理页面刷新数据丢失问题