1 Star 0 Fork 499

医药互联 / mall4j商城系统Uniapp端-mall4uni

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.js 625 Bytes
一键复制 编辑 原始数据 按行查看 历史
linzj 提交于 2021-03-01 11:06 . 初始化提交
import Vue from 'vue';
import App from './App';
Vue.config.productionTip = false;
Vue.mixin({
methods: {
setData: function(obj) {
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];
})
});
}
}
});
App.mpType = 'app';
const app = new Vue({
...App
});
app.$mount();
微信
1
https://gitee.com/pharmaceutical-interconnection/mall4uni.git
git@gitee.com:pharmaceutical-interconnection/mall4uni.git
pharmaceutical-interconnection
mall4uni
mall4j商城系统Uniapp端-mall4uni
master

搜索帮助