Skip to content

Commit

Permalink
fix: 修复部分情况多层 v-for 嵌套编译到小程序作用域错误的问题 fixed dcloudio#2034
Browse files Browse the repository at this point in the history
  • Loading branch information
zhetengbiji committed Aug 19, 2020
1 parent cf1551b commit a6b2dcd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function findScoped (path, test, state) {
path.traverse({
noScope: true,
Identifier (path) {
if (path.key !== 'key' && (path.key !== 'property' || path.parent.computed)) {
if (!match && path.key !== 'key' && (path.key !== 'property' || path.parent.computed)) {
match = isMatch(path.node.name, forItem, forIndex)
if (match) {
path.stop()
Expand All @@ -37,7 +37,7 @@ function findScoped (path, test, state) {
traverse(t.arrayExpression([test]), {
noScope: true,
Identifier (path) {
if (path.key !== 'key' && (path.key !== 'property' || path.parent.computed)) {
if (!match && path.key !== 'key' && (path.key !== 'property' || path.parent.computed)) {
const node = path.node
match = isMatch(node.name, forItem, forIndex) || scoped.declarationArray.find(({ declarations }) => declarations.find(({ id }) => id === node))
if (match) {
Expand Down

0 comments on commit a6b2dcd

Please sign in to comment.