You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.6 KiB

import App from './App'
import maphttp from './js/maphttp.js'
Vue.prototype.maphttp = maphttp;
import NB from './js/nb.js'
Vue.prototype.NB = NB;
import NBLogin from './js/nblogin.js'
Vue.prototype.NBlogin = NBLogin;
import COS from './js/COS.js';
Vue.prototype.COS = COS;
// 全局mixins,用于实现setData等功能';
import Mixin from './polyfill/mixins';
Vue.mixin(Mixin);
Vue.config.productionTip = false;
import nothing from '@/components/nothing/index.vue'
Vue.component('nothing',nothing)
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
// 引入 多语言包
import VueI18n from 'vue-i18n'
import WYMsg from 'static/language/index.js'//'./assets/lang/index.js'
Vue.prototype._i18n = WYMsg
App.mpType = 'app'
const app = new Vue({
WYMsg,
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
1 month ago
// #endif
// #ifdef APP-PLUS
// 1. 捕获 Vue 组件内的错误
Vue.config.errorHandler = function (err, vm, info) {
console.error('【Vue错误】:', err.message)
console.error('【位置】:', info)
console.error('【堆栈】:', err.stack)
}
// 2. 全局 JS 错误(不要依赖 document)
if (typeof window !== 'undefined') {
window.onerror = function (message, source, lineno, colno, error) {
console.error('【全局JS错误】:', message)
console.error('【堆栈】:', error?.stack)
}
// 3. 未捕获的 Promise 错误
window.addEventListener('unhandledrejection', function (event) {
console.error('【Promise错误】:', event.reason)
})
}
// #endif