import Vue from 'vue' import App from './App' import uView from 'uview-ui'; Vue.use(uView); //封装api import { api } from 'assets/http/api.js' Vue.prototype.$api = api //引入util.js import Util from 'utils/util.js' Vue.prototype.$util = Util //封装缓存 import simpleCache from "@/utils/cache.js" Vue.prototype.$cache = simpleCache //封装判空函数 Vue.prototype.$isEmpty=function(value){ switch (typeof value) { case 'undefined': return true; case 'string': if(value=='undefined') return true if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true; break; case 'boolean': if (!value) return true; break; case 'number': if (0 === value || isNaN(value)) return true; break; case 'object': if (null === value || value.length === 0) return true; for (var i in value) { return false; } return true; } return false; } Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ ...App }) app.$mount()