examTeamApp/main.js

60 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-05-02 15:59:36 +08:00
import App from './App'
2025-04-18 14:53:38 +08:00
import messages from '@/locale/index.js'
2024-05-02 15:59:36 +08:00
// vuex
import store from './store'
Vue.prototype.$store = store;
// 公共js
import tools from '@/toolJs/tools.js'
2024-05-02 15:59:36 +08:00
Vue.prototype.$tools = tools;
2024-07-22 14:13:19 +08:00
// 蓝牙js
import Bluetooth from '@/toolJs/Bluetooth.js'
2024-07-22 14:13:19 +08:00
Vue.prototype.$Bluetooth = Bluetooth;
2024-05-02 15:59:36 +08:00
//请求
import http from '@/toolJs/https.js'
2024-05-02 15:59:36 +08:00
Vue.prototype.$http = http;
//接口
import model from '@/toolJs/model.js'
2024-05-02 15:59:36 +08:00
Vue.prototype.$model = model;
// 语言
2024-05-02 15:59:36 +08:00
let i18nConfig = {
2025-04-26 13:35:30 +08:00
locale: uni.getStorageSync('language'),
2024-05-02 15:59:36 +08:00
messages
}
2025-04-18 14:53:38 +08:00
//模拟数据
import video from '@/video.json'
Vue.prototype.$video = video;
2024-05-02 15:59:36 +08:00
// #ifndef VUE3
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
const i18n = new VueI18n(i18nConfig)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
i18n,
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
import {
createI18n
} from 'vue-i18n'
const i18n = createI18n(i18nConfig)
export function createApp() {
const app = createSSRApp(App)
app.use(i18n)
return {
app
}
}
// #endif