mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 07:55:53 +08:00
feat: 🎨 在config中新增5个便捷功能选项,更加简单便捷配置以及使用代码。优化部分冗余的代码
This commit is contained in:
19
main.js
19
main.js
@@ -3,17 +3,18 @@ import App from "./App";
|
||||
import * as filters from "./utils/filters.js"; // global filter
|
||||
import uView from "uview-ui";
|
||||
import store from "./store";
|
||||
|
||||
|
||||
import config from '@/config/config';
|
||||
import airBtn from "@/components/m-airbtn/index.vue";
|
||||
/**
|
||||
* 仅在h5中显示唤醒app功能
|
||||
* 在h5页面手动挂载
|
||||
*
|
||||
*/
|
||||
// #ifdef H5
|
||||
import airBtn from "@/components/m-airbtn/index.vue";
|
||||
let btn = Vue.component("airBtn", airBtn); //全局注册
|
||||
document.body.appendChild(new btn().$mount().$el);
|
||||
if(config.enableMiniBarStartUpApp){
|
||||
let btn = Vue.component("airBtn", airBtn); //全局注册
|
||||
document.body.appendChild(new btn().$mount().$el);
|
||||
}
|
||||
// #endif
|
||||
|
||||
// 引入uView对小程序分享的mixin封装
|
||||
@@ -30,8 +31,6 @@ Object.keys(filters).forEach((key) => {
|
||||
|
||||
// 引入Vuex
|
||||
Vue.prototype.$store = store;
|
||||
|
||||
|
||||
Vue.use(uView);
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
@@ -43,11 +42,11 @@ Vue.config.productionTip = false;
|
||||
* 如需更换主题请修改此处以及uni.scss中的全局颜色
|
||||
*/
|
||||
// 主题色
|
||||
Vue.prototype.$mainColor = "#ff3c2a";
|
||||
Vue.prototype.$mainColor = config.mainColor;
|
||||
// 高亮主题色
|
||||
Vue.prototype.$lightColor = "#ff6b35";
|
||||
Vue.prototype.$lightColor = config.lightColor;
|
||||
// 辅助高亮颜色
|
||||
Vue.prototype.$aiderLightColor = "#ff9f28";
|
||||
Vue.prototype.$aiderLightColor = config.aiderLightColor;
|
||||
|
||||
|
||||
App.mpType = "app";
|
||||
|
||||
Reference in New Issue
Block a user