import api from './lib/functions.js' import tools from './lib/tools.js' import service from "@/uni_modules/m-view/lib/request"; const $m = { ...api, ...tools, service } // $m挂载到uni对象上 uni.$m = $m const install = (Vue) => { // #ifndef APP-NVUE // 只有vue,挂载到Vue.prototype才有意义,因为nvue中全局Vue.prototype和Vue.mixin是无效的 Vue.config.globalProperties.$m = $m // 暂时兼容vue2的$nextTick写法 Vue.config.globalProperties.$nextTick = (cb) => { cb(); } // #endif } export default { install }