WXL (wul)
4 天以前 94ce59bb6e94bd5e78f32d921ce5c14d641dabc8
src/main.js
@@ -92,6 +92,14 @@
  Vue.filter(key, filters[key]);
}
import moment from "moment"
// 1. 在main.js中添加错误监听
window.addEventListener('unhandledrejection', (event) => {
  if (event.reason && event.reason.message &&
      event.reason.message.includes('Loading chunk')) {
    // 重新加载页面
    window.location.reload();
  }
});
Vue.prototype.$moment = moment;