当前位置: 代码迷 >> 综合 >> router.onError
  详细解决方案

router.onError

热度:26   发布时间:2023-11-18 09:03:25.0
router.onError((error) => {
    const pattern = /Loading chunk (\d)+ failed/g;const isChunkLoadFailed = error.message.match(pattern);const targetPath = router.history.pending.fullPath;if (isChunkLoadFailed) {
    router.replace(targetPath);}
});
  相关解决方案