Vue更新文件后刷新页面

Posted tujw

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vue更新文件后刷新页面相关的知识,希望对你有一定的参考价值。

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更新文件后刷新页面的主要内容,如果未能解决你的问题,请参考以下文章