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;