Skip to content

Commit

Permalink
fix: don't incremental update for v-for expression
Browse files Browse the repository at this point in the history
close #2266
  • Loading branch information
johnsoncodehk committed Jan 4, 2023
1 parent fcb1c6f commit e1509e6
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -83,6 +83,9 @@ const plugin: VueLanguagePlugin = ({ modules }) => {
if (node.arg && withinChangeRange(node.arg.loc) && node.name === 'slot') {
return false;
}
if (node.exp && withinChangeRange(node.exp.loc) && node.name === 'for') { // #2266
return false;
}
if (node.arg && !tryUpdateNode(node.arg)) {
return false;
}
Expand All @@ -105,11 +108,11 @@ const plugin: VueLanguagePlugin = ({ modules }) => {
}
}
else if (node.type === CompilerDOM.NodeTypes.IF) {
for (const branche of node.branches) {
if (branche.condition && !tryUpdateNode(branche.condition)) {
for (const branch of node.branches) {
if (branch.condition && !tryUpdateNode(branch.condition)) {
return false;
}
for (const child of branche.children) {
for (const child of branch.children) {
if (!tryUpdateNode(child)) {
return false;
}
Expand Down

0 comments on commit e1509e6

Please sign in to comment.