cashier-ipad/main.js

69 lines
1.7 KiB
JavaScript
Raw Permalink 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.

// 设置env配置文件
import envConfig from '@/env/config.js'
// 全局配置项
import appConfig from '@/config/appConfig.js'
import storageManage from '@/commons/utils/storageManage.js'
import uviewPlus,{setConfig} from 'uview-plus'
import dict from '@/commons/utils/dict.js'
// 下面的在特殊场景下才需要配置通常不用配置即可直接使用uvire-plus框架。
import {utils} from '@/commons/utils/index.js'
// 调用setConfig方法方法内部会进行对象属性深度合并可以放心嵌套配置
// 需要在app.use(uview-plus)之后执行
setConfig({
// 修改$u.config对象的属性
config: {
// 修改默认单位为rpx相当于执行 uni.$u.config.unit = 'rpx'
unit: 'px'
},
// 修改$u.props对象的属性
props: {
// 修改radio组件的size参数的默认值相当于执行 uni.$u.props.radio.size = 30
radio: {
// size: 20
}
// 其他组件属性配置
// ......
}
})
// 设置node环境
envConfig.changeEnv(storageManage.env())
// import VConsole from 'vconsole';
// 初始化vConsole
// const vConsole = new VConsole({
// defaultPlugins: ['console']
// });
// #ifndef VUE3
import App from './App'
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
const app = createSSRApp(App)
app.use(uviewPlus)
app.config.globalProperties.$appName = appConfig.appName
uni.$appName = appConfig.appName
app.config.globalProperties.$utils = utils
uni.$utils = utils
app.config.globalProperties.$dict = dict
uni.$dict = dict
return {
app
}
}
// #endif