1 Star 1 Fork 1

弈联数聚 / shengyibao

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.js 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
弈联数聚 提交于 2023-05-23 14:53 . first commit
import Vue from 'vue';
import store from "./store/index";
import App from './App';
import tui from './utils/httpRequest'
import appUpdata from './utils/appUpdata'
// import EventBus from './utils/EventBus'
const msg = (title, duration = 1500, mask = false, icon = 'none') => {
//统一提示方便全局修改
/* #ifndef APP-PLUS */
if(Boolean(title) === false){
return;
}
uni.showToast({
title,
duration,
mask,
icon
});
/* #endif */
/* #ifdef APP-PLUS */
plus.nativeUI.toast(title, {
align: 'center',
duration: 1500
})
/* #endif */
return;
}
/* #ifdef H5 */
const s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'https://sdk.canva.cn/v2/beta/api.js';
document.body.appendChild(s);
/* #endif */
Vue.config.productionTip = false;
Vue.prototype.$store = store;
Vue.prototype.$api = {msg};
/* #ifdef APP-PLUS */
Vue.prototype.$nextTick = (next) => {
setTimeout(next)
};
/* #endif */
Vue.prototype.tui = tui
Vue.prototype.appUpdata = appUpdata
// Vue.prototype.$bus = new EventBus()
Vue.mixin({
methods: {
setData: function(obj, callback) {
let that = this;
let keys = [];
let val, data;
Object.keys(obj).forEach(function(key) {
keys = key.split('.');
val = obj[key];
data = that.$data;
keys.forEach(function(key2, index) {
if (index + 1 == keys.length) {
that.$set(data, key2, val);
} else {
if (!data[key2]) {
that.$set(data, key2, {});
}
}
data = data[key2];
})
});
callback && callback();
}
}
});
App.mpType = 'app';
const app = new Vue({
...App,
store
});
app.$mount();
1
https://gitee.com/yi-lian-shu-ju/shengyibao.git
git@gitee.com:yi-lian-shu-ju/shengyibao.git
yi-lian-shu-ju
shengyibao
shengyibao
master

搜索帮助