1 Star 0 Fork 0

xy_mall / mall4uni

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.js 625 Bytes
一键复制 编辑 原始数据 按行查看 历史
etimgroup 提交于 2023-09-05 17:21 . 'init'
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/lc_page/mall4uni.git
git@gitee.com:lc_page/mall4uni.git
lc_page
mall4uni
mall4uni
master

搜索帮助