兼兼街租房小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

42 lines
858 B

import Vue from 'vue';
import App from './App';
import request from '@/common/axios.js';
import tokenUtil from '@/common/token.js';
Vue.config.productionTip = false;
Vue.prototype.$request = request;
Vue.prototype.$tokenUtil = tokenUtil;
Vue.prototype.$token = tokenUtil.token;
Vue.prototype.$user = tokenUtil.user;
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();