router.onError(error => {
const pattern = /Loading chunk/g;
const isChunkLoadFailed = error.message.match(pattern);
const targetPath = router.history.pending.fullPath;
if (isChunkLoadFailed) {
window.history.replaceState({}, document.title, targetPath);
window.location.reload();
}
});
Vue更新文件后刷新页面
猜你喜欢
转载自www.cnblogs.com/tujw/p/12368750.html
今日推荐
周排行