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();
}
});
原文地址:https://www.cnblogs.com/tujw/p/12368750.html
时间: 2024-10-21 16:08:27