第一步:修改app.vue文件
<template><div id="app"><div class="content"><router-view v-if="routerAlive"></router-view></div></div></template><script>export default{data(){return{routerAlive: true,}},provide(){return{routerRefresh: this.routerRefresh}},methods:{routerRefresh(){this.routerAlive = false;this.$nextTick(()=>{this.routerAlive = true;});}}}</script><style></style>
第二步:在页面跳转相应的js文件export default中进行修改
添加一行:
inject: ['routerRefresh']
在跳转方法中修改:
let url = "/getList?ID=" + item.id;this.$router.push(url);this.routerRefresh();
如果觉得《VUE解决路由里的参数改变页面却没有跳转的问题》对你有帮助,请点赞、收藏,并留下你的观点哦!