fix(compiler-core): v-if key error should only be checking same key on different branches

This commit is contained in:
Evan You
2020-08-04 12:01:07 -04:00
parent c3f8c780e7
commit de0c8a7e3e
5 changed files with 74 additions and 15 deletions

View File

@@ -161,7 +161,11 @@ export function findProp(
if (p.name === name && (p.value || allowEmpty)) {
return p
}
} else if (p.name === 'bind' && p.exp && isBindKey(p.arg, name)) {
} else if (
p.name === 'bind' &&
(p.exp || allowEmpty) &&
isBindKey(p.arg, name)
) {
return p
}
}