From 29bffca83916d98ca0a6777c99497f78c450a61b Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 27 Dec 2019 20:20:39 +0800 Subject: [PATCH] fix(mp-alipay): add createSelectorQuery,createIntersectionObserver --- .../packages/mp-vue/dist/mp.runtime.esm.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js b/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js index baff018d..db82506e 100644 --- a/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js +++ b/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js @@ -5829,9 +5829,18 @@ function internalMixin(Vue) { MP_METHODS.forEach(function (method) { Vue.prototype[method] = function(args) { - if (this.$scope) { + if (this.$scope && this.$scope[method]) { return this.$scope[method](args) } + // 主要是 mp-alipay + if (method === 'createSelectorQuery') { + /* eslint-disable no-undef */ + return uni.createSelectorQuery(args).in(this) + } else if (method === 'createIntersectionObserver') { + /* eslint-disable no-undef */ + return uni.createIntersectionObserver(this, args) + } + // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent }; }); -- GitLab