emis-app/main.js
2024-06-16 12:03:00 +08:00

72 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import App from './App'
import store from './store'
import uviewPlus from '@/uni_modules/uview-plus'
import { mixins } from "./mixins"
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.$adpid = "1111111111"
Vue.prototype.$backgroundAudioData = {
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
}
App.mpType = 'app'
const app = new Vue({
store,
...App
})
app.mixin(mixins);
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
app.mixin(mixins);
app.use(uviewPlus)
// 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置
// 需要在app.use(uview-plus)之后执行
uni.$u.setConfig({
color: {
'u-primary': '#B12D29',
},
// 修改$u.config对象的属性
config: {
// 修改默认单位为rpx,相当于执行 uni.$u.config.unit = 'rpx'
unit: 'rpx'
},
// 修改$u.props对象的属性
props: {
// 修改radio组件的size参数的默认值,相当于执行 uni.$u.props.radio.size = 30
radio: {
// size: 15
}
// 其他组件属性配置
// ......
}
})
app.use(store)
// #ifdef APP-PLUS
app.config.globalProperties.isAppChannel = true
// #endif
app.config.globalProperties.$adpid = "1111111111"
app.config.globalProperties.$backgroundAudioData = {
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
}
return {
app
}
}
// #endif