emis-sapp/main.js

68 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2023-11-25 16:29:44 +00:00
import App from './App'
import store from './store'
2023-11-29 16:58:09 +00:00
import uviewPlus from '@/uni_modules/uview-plus'
2024-05-31 10:42:15 +00:00
import { mixins } from "./mixins"
2023-11-25 16:29:44 +00:00
// #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
})
2024-05-31 10:42:15 +00:00
app.mixin(mixins);
2023-11-25 16:29:44 +00:00
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
2024-05-31 10:42:15 +00:00
app.mixin(mixins);
2023-11-29 16:58:09 +00:00
app.use(uviewPlus)
// 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置
// 需要在app.use(uview-plus)之后执行
uni.$u.setConfig({
2023-12-05 07:13:15 +00:00
color: {
'u-primary': '#B12D29',
},
2023-11-29 16:58:09 +00:00
// 修改$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
}
// 其他组件属性配置
// ......
}
})
2023-11-25 16:29:44 +00:00
app.use(store)
2024-05-31 10:42:15 +00:00
2023-11-25 16:29:44 +00:00
app.config.globalProperties.$adpid = "1111111111"
app.config.globalProperties.$backgroundAudioData = {
playing: false,
playTime: 0,
formatedPlayTime: '00:00:00'
}
return {
app
}
}
// #endif