router.beforeEach((to, from, next) => {
console.log(from.path, 'from.pathfrom.path')
if (from.path == '/Videosquare') {
// 在想要清楚的页面的下个页面添加判断,加载新页面之前强制刷新一次,
// 相当于点击一次页面左上角的刷新,来结束所有网络进程请求
location.reload()
next()
}
next()
})
VUE2VUE3适用页面跳转前清除所有请求(简单粗暴)
最新推荐文章于 2024-06-03 17:37:28 发布