WXL (wul)
2026-05-08 f9902f7a3b79d22bde9f199263ac36de26816470
src/main.js
@@ -51,6 +51,7 @@
import {
  parseTime,
  formatTime,
  followupAuthority,
  resetForm,
  addDateRange,
  selectDictLabel,
@@ -92,6 +93,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;
@@ -103,6 +112,7 @@
Vue.prototype.formatTime = formatTime;
Vue.prototype.daysBetween = daysBetween;
Vue.prototype.resetForm = resetForm;
Vue.prototype.followupAuthority = followupAuthority;
Vue.prototype.addDateRange = addDateRange;
Vue.prototype.selectDictLabel = selectDictLabel;
Vue.prototype.selectDictLabels = selectDictLabels;