码迷,mamicode.com
首页 > 其他好文 > 详细

Vue更新文件后刷新页面

时间:2020-02-26 20:28:28      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:ace   end   err   pat   cat   pattern   title   ror   mes   

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更新文件后刷新页面

标签:ace   end   err   pat   cat   pattern   title   ror   mes   

原文地址:https://www.cnblogs.com/tujw/p/12368750.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!