From ea1764e506c3283027c483f2598b3e64d1b2f7e1 Mon Sep 17 00:00:00 2001 From: chenjiajian <798095202@qq.com> Date: Mon, 27 May 2019 16:23:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(taro-alipay):=20=E4=BF=AE=E5=A4=8D=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AE=9D=E5=B0=8F=E7=A8=8B=E5=BA=8F=20componentWillUn?= =?UTF-8?q?mount=20=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8Cc?= =?UTF-8?q?lose=20#3167?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支付宝小程序页面对象不存在 props 属性,所以取 props.compid 前需要先判断是否存在 props。 --- packages/taro-alipay/src/create-component.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/taro-alipay/src/create-component.js b/packages/taro-alipay/src/create-component.js index 734320f6a266..877bda51f3a3 100644 --- a/packages/taro-alipay/src/create-component.js +++ b/packages/taro-alipay/src/create-component.js @@ -172,8 +172,10 @@ export function componentTrigger (component, key, args) { } if (key === 'componentWillUnmount') { - const compid = component.$scope.props.compid - if (compid) propsManager.delete(compid) + if (component.$scope.props) { + const compid = component.$scope.props.compid + if (compid) propsManager.delete(compid) + } } component[key] && typeof component[key] === 'function' && component[key](...args)