WXL (wul)
4 天以前 15371b329484632c987e349e50f41cab90d3ae8c
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;