From cfa0ae46df6de2948227dd17a16ed216c95f4b30 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Tue, 19 Nov 2019 20:54:04 +0800 Subject: [PATCH] npm run build:runtime --- packages/uni-app-plus/dist/index.js | 19 +++++++++++++------ packages/uni-mp-alipay/dist/index.js | 19 +++++++++++++------ packages/uni-mp-baidu/dist/index.js | 19 +++++++++++++------ packages/uni-mp-qq/dist/index.js | 19 +++++++++++++------ packages/uni-mp-toutiao/dist/index.js | 19 +++++++++++++------ packages/uni-mp-weixin/dist/index.js | 19 +++++++++++++------ 6 files changed, 78 insertions(+), 36 deletions(-) diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 2edd4e89..c086103b 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -1134,10 +1134,10 @@ const hooks = [ function parseBaseApp (vm, { mocks, initRefs -}) { - if (vm.$options.store) { - Vue.prototype.$store = vm.$options.store; - } +}) { + if (vm.$options.store) { + Vue.prototype.$store = vm.$options.store; + } Vue.prototype.mpHost = "app-plus"; @@ -1178,8 +1178,8 @@ function parseBaseApp (vm, { app: this }; - this.$vm.$scope = this; - // vm 上也挂载 globalData + this.$vm.$scope = this; + // vm 上也挂载 globalData this.$vm.globalData = this.globalData; this.$vm._isMounted = true; @@ -1191,6 +1191,13 @@ function parseBaseApp (vm, { // 兼容旧版本 globalData appOptions.globalData = vm.$options.globalData || {}; + // 将 methods 中的方法挂在 getApp() 中 + const methods = vm.$options.methods; + if (methods) { + Object.keys(methods).forEach(name => { + appOptions[name] = methods[name]; + }); + } initHooks(appOptions, hooks); diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index 4fca9f73..56af4cf4 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -1526,10 +1526,10 @@ const hooks = [ function parseBaseApp (vm, { mocks, initRefs -}) { - if (vm.$options.store) { - Vue.prototype.$store = vm.$options.store; - } +}) { + if (vm.$options.store) { + Vue.prototype.$store = vm.$options.store; + } Vue.prototype.mpHost = "mp-alipay"; @@ -1570,8 +1570,8 @@ function parseBaseApp (vm, { app: this }; - this.$vm.$scope = this; - // vm 上也挂载 globalData + this.$vm.$scope = this; + // vm 上也挂载 globalData this.$vm.globalData = this.globalData; this.$vm._isMounted = true; @@ -1583,6 +1583,13 @@ function parseBaseApp (vm, { // 兼容旧版本 globalData appOptions.globalData = vm.$options.globalData || {}; + // 将 methods 中的方法挂在 getApp() 中 + const methods = vm.$options.methods; + if (methods) { + Object.keys(methods).forEach(name => { + appOptions[name] = methods[name]; + }); + } initHooks(appOptions, hooks); diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index ed18e1bb..bd339e8e 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -1271,10 +1271,10 @@ const hooks = [ function parseBaseApp (vm, { mocks, initRefs -}) { - if (vm.$options.store) { - Vue.prototype.$store = vm.$options.store; - } +}) { + if (vm.$options.store) { + Vue.prototype.$store = vm.$options.store; + } Vue.prototype.mpHost = "mp-baidu"; @@ -1315,8 +1315,8 @@ function parseBaseApp (vm, { app: this }; - this.$vm.$scope = this; - // vm 上也挂载 globalData + this.$vm.$scope = this; + // vm 上也挂载 globalData this.$vm.globalData = this.globalData; this.$vm._isMounted = true; @@ -1328,6 +1328,13 @@ function parseBaseApp (vm, { // 兼容旧版本 globalData appOptions.globalData = vm.$options.globalData || {}; + // 将 methods 中的方法挂在 getApp() 中 + const methods = vm.$options.methods; + if (methods) { + Object.keys(methods).forEach(name => { + appOptions[name] = methods[name]; + }); + } initHooks(appOptions, hooks); diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index edfd191a..a6941563 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -1189,10 +1189,10 @@ const hooks = [ function parseBaseApp (vm, { mocks, initRefs -}) { - if (vm.$options.store) { - Vue.prototype.$store = vm.$options.store; - } +}) { + if (vm.$options.store) { + Vue.prototype.$store = vm.$options.store; + } Vue.prototype.mpHost = "mp-qq"; @@ -1238,8 +1238,8 @@ function parseBaseApp (vm, { app: this }; - this.$vm.$scope = this; - // vm 上也挂载 globalData + this.$vm.$scope = this; + // vm 上也挂载 globalData this.$vm.globalData = this.globalData; this.$vm._isMounted = true; @@ -1251,6 +1251,13 @@ function parseBaseApp (vm, { // 兼容旧版本 globalData appOptions.globalData = vm.$options.globalData || {}; + // 将 methods 中的方法挂在 getApp() 中 + const methods = vm.$options.methods; + if (methods) { + Object.keys(methods).forEach(name => { + appOptions[name] = methods[name]; + }); + } initHooks(appOptions, hooks); diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index 9f7142b8..ae936d93 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -1281,10 +1281,10 @@ const hooks = [ function parseBaseApp (vm, { mocks, initRefs -}) { - if (vm.$options.store) { - Vue.prototype.$store = vm.$options.store; - } +}) { + if (vm.$options.store) { + Vue.prototype.$store = vm.$options.store; + } Vue.prototype.mpHost = "mp-toutiao"; @@ -1325,8 +1325,8 @@ function parseBaseApp (vm, { app: this }; - this.$vm.$scope = this; - // vm 上也挂载 globalData + this.$vm.$scope = this; + // vm 上也挂载 globalData this.$vm.globalData = this.globalData; this.$vm._isMounted = true; @@ -1338,6 +1338,13 @@ function parseBaseApp (vm, { // 兼容旧版本 globalData appOptions.globalData = vm.$options.globalData || {}; + // 将 methods 中的方法挂在 getApp() 中 + const methods = vm.$options.methods; + if (methods) { + Object.keys(methods).forEach(name => { + appOptions[name] = methods[name]; + }); + } initHooks(appOptions, hooks); diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index 107520ea..4cae2bb8 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -1129,10 +1129,10 @@ const hooks = [ function parseBaseApp (vm, { mocks, initRefs -}) { - if (vm.$options.store) { - Vue.prototype.$store = vm.$options.store; - } +}) { + if (vm.$options.store) { + Vue.prototype.$store = vm.$options.store; + } Vue.prototype.mpHost = "mp-weixin"; @@ -1178,8 +1178,8 @@ function parseBaseApp (vm, { app: this }; - this.$vm.$scope = this; - // vm 上也挂载 globalData + this.$vm.$scope = this; + // vm 上也挂载 globalData this.$vm.globalData = this.globalData; this.$vm._isMounted = true; @@ -1191,6 +1191,13 @@ function parseBaseApp (vm, { // 兼容旧版本 globalData appOptions.globalData = vm.$options.globalData || {}; + // 将 methods 中的方法挂在 getApp() 中 + const methods = vm.$options.methods; + if (methods) { + Object.keys(methods).forEach(name => { + appOptions[name] = methods[name]; + }); + } initHooks(appOptions, hooks); -- GitLab