问题:
我做项目的时候 发现vue返回上一页的时候,
有时候router不会读取router上的参数,就会导致我的项目空白。
思路:
让返回上一页的时候,上一页能读取到路由参数
解决:
根据上下页的name为判定 去给上一页刷新
this.$router.beforeResolve((to, from, next) => {
if (to.name == "enterprise-detail" && from.name == "enterprise-approve") {
this.$router.go();
}
next();
});