From 9346f034443a5a9bc5d6251e1b5c26b8438bbf30 Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 28 Jul 2020 16:58:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=9F=A5=E6=89=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-mp-alipay/lib/uni.compiler.js | 2 +- .../uni-template-compiler/lib/script/traverse/data/event.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni-mp-alipay/lib/uni.compiler.js b/packages/uni-mp-alipay/lib/uni.compiler.js index ba74a36a8..69ebd4255 100644 --- a/packages/uni-mp-alipay/lib/uni.compiler.js +++ b/packages/uni-mp-alipay/lib/uni.compiler.js @@ -126,7 +126,7 @@ module.exports = { Identifier (path) { const node = path.node const name = node.name - if (names.includes(name) && path.key !== 'key' && path.key !== 'property' && !(path.scope && path.scope.hasBinding(name))) { + if (names.includes(name) && path.key !== 'key' && (path.key !== 'property' || path.parent.computed) && !(path.scope && path.scope.hasBinding(name))) { path.replaceWithSourceString(`${paramName}.${name}`) } } diff --git a/packages/uni-template-compiler/lib/script/traverse/data/event.js b/packages/uni-template-compiler/lib/script/traverse/data/event.js index bbb42c8b2..12760adf6 100644 --- a/packages/uni-template-compiler/lib/script/traverse/data/event.js +++ b/packages/uni-template-compiler/lib/script/traverse/data/event.js @@ -335,7 +335,7 @@ function parseEvent (keyPath, valuePath, state, isComponent, isNativeOn = false, const scope = path.scope const node = path.node const name = node.name - if (path.key !== 'key' && path.key !== 'property' && scope && !scope.hasOwnBinding(name) && scope.hasBinding(name)) { + if (path.key !== 'key' && (path.key !== 'property' || path.parent.computed) && scope && !scope.hasOwnBinding(name) && scope.hasBinding(name)) { params.push(name) } } -- GitLab