Initial commit
This commit is contained in:
90
main.js
Normal file
90
main.js
Normal file
@@ -0,0 +1,90 @@
|
||||
import App from "./App";
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from "vue";
|
||||
import "./uni.promisify.adaptor";
|
||||
|
||||
import store from "./store";
|
||||
import { v1 as uuidv1 } from "uuid";
|
||||
|
||||
// main.js,注意要在use方法之后执行
|
||||
import uView from "uview-ui";
|
||||
import tabBar from "components/tabBar/tabBar.vue"; //引入我们自己定义的tabBar组件
|
||||
import noBadTable from "components/no-bad-table/table.vue";
|
||||
|
||||
Vue.use(uView);
|
||||
|
||||
// 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置
|
||||
// 需要在Vue.use(uView)之后执行
|
||||
uni.$u.setConfig({
|
||||
// 修改$u.config对象的属性
|
||||
config: {
|
||||
// 修改默认单位为rpx,相当于执行 uni.$u.config.unit = 'rpx'
|
||||
unit: "rpx",
|
||||
},
|
||||
// 修改$u.props对象的属性
|
||||
props: {
|
||||
// 修改radio组件的size参数的默认值,相当于执行 uni.$u.props.radio.size = 30
|
||||
radio: {
|
||||
size: 30,
|
||||
},
|
||||
text: {
|
||||
size: 30,
|
||||
},
|
||||
search: {
|
||||
height: 60,
|
||||
},
|
||||
form: {
|
||||
labelWidth: 160,
|
||||
},
|
||||
actionSheet: {
|
||||
round: 40,
|
||||
},
|
||||
datetimePicker: {
|
||||
value: Number(new Date()),
|
||||
},
|
||||
checkbox: {
|
||||
labelSize: 24,
|
||||
},
|
||||
// badge: {
|
||||
// bgColor: "#c2d10a",
|
||||
// },
|
||||
subsection: {
|
||||
activeColor: "#687379",
|
||||
},
|
||||
loadingPage: {
|
||||
loadingColor: "#c2d10a",
|
||||
color: "#c2d10a",
|
||||
iconSize: 112,
|
||||
fontSize: 38,
|
||||
},
|
||||
// 其他组件属性配置
|
||||
// ......
|
||||
},
|
||||
});
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.uuidv1 = uuidv1;
|
||||
Vue.prototype.$store = store;
|
||||
Vue.component("tab-bar", tabBar); //使用tabBar组件
|
||||
Vue.component("no-bad-table", noBadTable); //使用tabBar组件
|
||||
import Api from "./api";
|
||||
Vue.prototype.$api = Api;
|
||||
Vue.config.productionTip = false;
|
||||
App.mpType = "app";
|
||||
const app = new Vue({
|
||||
store,
|
||||
...App,
|
||||
});
|
||||
app.$mount();
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from "vue";
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App);
|
||||
return {
|
||||
app,
|
||||
};
|
||||
}
|
||||
// #endif
|
||||
Reference in New Issue
Block a user