optimize: 捕获页面加载过程中的异常,并打印在控制台中。
parent
6d57101b2f
commit
bd1b5b2202
|
@ -9,6 +9,7 @@ import 'ant-design-vue/dist/antd.css'
|
|||
import './view/style/index.scss'
|
||||
import './view/style/theme/dark.scss' // 暗色主题
|
||||
|
||||
try {
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(antd)
|
||||
Vue.use(VueRouter)
|
||||
|
@ -38,3 +39,6 @@ const VueRouterReplace = VueRouter.prototype.replace
|
|||
VueRouter.prototype.replace = function replace (location) {
|
||||
return VueRouterReplace.call(this, location).catch(err => err)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('页面加载出现未知异常:', e)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue