From 04ead615800ea3bd942eea8615b0723f1a595c3c Mon Sep 17 00:00:00 2001 From: lyfeyaj Date: Wed, 26 Apr 2023 14:47:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(runtime-mini):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E6=96=B9=E6=B3=95=E6=B3=A8=E5=85=A5=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/runtime-mini/src/alipay/utilsToAlipay.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/runtime-mini/src/alipay/utilsToAlipay.ts b/packages/runtime-mini/src/alipay/utilsToAlipay.ts index 71cf4384..2d357051 100644 --- a/packages/runtime-mini/src/alipay/utilsToAlipay.ts +++ b/packages/runtime-mini/src/alipay/utilsToAlipay.ts @@ -195,12 +195,7 @@ export function injectComponentSelectorMethodsSupport( } // 如果支付宝已支持 selectComponent 或 selectAllComponents 则不注入 - if (!isSelectComponentSupported || type === 'page') { - // 选择组件支持 - options.selectComponent = generateSelectFunction('selectComponent') - // 选择组件支持(多个) - options.selectAllComponents = generateSelectFunction('selectAllComponents') - } else { + if (isSelectComponentSupported && type === 'component') { // 选择组件支持 options.selectComponent = function (...args: any) { return this.$selectComponent(...args) @@ -209,6 +204,11 @@ export function injectComponentSelectorMethodsSupport( options.selectAllComponents = function (...args: any) { return this.$selectAllComponents(...args) } + } else { + // 选择组件支持 + options.selectComponent = generateSelectFunction('selectComponent') + // 选择组件支持(多个) + options.selectAllComponents = generateSelectFunction('selectAllComponents') } // 如果支付宝已支持 selectOwnerComponent 则不注入