优化小程序登录跳转部分代码.新增全局条件编译跳转方法

This commit is contained in:
lemon橪
2021-08-17 11:53:56 +08:00
parent 3d1e175194
commit d76bab4b71
12 changed files with 68 additions and 41 deletions

19
main.js
View File

@@ -11,25 +11,11 @@ let btn = Vue.component("airBtn", airBtn); //全局注册
document.body.appendChild(new btn().$mount().$el);
// #endif
Object.keys(filters).forEach((key) => {
Vue.filter(key, filters[key]);
});
const msg = (title, duration = 1500, mask = false, icon = "none") => {
//统一提示方便全局修改
if (Boolean(title) === false) {
return;
}
uni.showToast({
title,
duration,
mask,
icon,
});
};
// 引入vuex
// 引入Vuex
Vue.prototype.$store = store;
Vue.use(uView);
Vue.config.productionTip = false;
@@ -37,8 +23,7 @@ Vue.config.productionTip = false;
Vue.prototype.$mainColor = "#ff3c2a";
// 高亮主题色
Vue.prototype.$lightColor = "#ff6b35";
// 可直接 this.$api调用
Vue.prototype.$api = { msg };
App.mpType = "app";