初始化产品库
This commit is contained in:
		
							
								
								
									
										39
									
								
								src/main.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								src/main.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
import Vue from 'vue';
 | 
			
		||||
import App from './App';
 | 
			
		||||
import store from './store';
 | 
			
		||||
import axios from './common/axios';
 | 
			
		||||
import utils from './common/util';
 | 
			
		||||
import dayjs from 'dayjs';
 | 
			
		||||
import mixin from './uview/libs/mixin/mixin';
 | 
			
		||||
 | 
			
		||||
Vue.config.productionTip = false;
 | 
			
		||||
Vue.prototype.$store = store;
 | 
			
		||||
//初始化接口工具类
 | 
			
		||||
axios.defaults.baseURL = store.state.baseURL;
 | 
			
		||||
Vue.prototype.$http = axios;
 | 
			
		||||
Vue.prototype.$cdn = 'https://cdn.cunwuyun.cn/dvcp/h5/';
 | 
			
		||||
Vue.prototype.imgHomeUrl = 'https://cdn.cunwuyun.cn/dvcp/h5/home/';
 | 
			
		||||
Vue.prototype.imgOtherUrl = 'https://cdn.cunwuyun.cn/dvcp/h5/other/';
 | 
			
		||||
Vue.prototype.$formatName = (name) => {
 | 
			
		||||
	if (name == undefined) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	return name.substr(name.length - 2, name.length > 2 ? name.length - 1 : name.length);
 | 
			
		||||
};
 | 
			
		||||
Object.keys(utils).map((e) => (Vue.prototype['$' + e] = utils[e]));
 | 
			
		||||
let relativeTime = require('dayjs/plugin/relativeTime');
 | 
			
		||||
require('dayjs/locale/zh-cn');
 | 
			
		||||
let dayjs_plugin_duration = require('dayjs/plugin/duration');
 | 
			
		||||
dayjs.extend(dayjs_plugin_duration);
 | 
			
		||||
dayjs.extend(relativeTime);
 | 
			
		||||
Vue.prototype.$dayjs = dayjs;
 | 
			
		||||
Vue.mixin(mixin);
 | 
			
		||||
 | 
			
		||||
App.mpType = 'app';
 | 
			
		||||
process.env.NODE_ENV == 'development' && new VConsole();
 | 
			
		||||
const app = new Vue({
 | 
			
		||||
	store,
 | 
			
		||||
	...App
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
app.$mount();
 | 
			
		||||
		Reference in New Issue
	
	Block a user