Skip to content

Commit e534276

Browse files
committed
avoid re-render when two-way binding primitive values in v-for (fix #1791)
1 parent 3fe34fa commit e534276

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/watcher.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ Watcher.prototype.set = function (value) {
156156
)
157157
return
158158
}
159-
if (scope.$key) { // original is an object
160-
forContext.rawValue[scope.$key] = value
161-
} else {
162-
forContext.rawValue.$set(scope.$index, value)
163-
}
159+
forContext._withLock(function () {
160+
if (scope.$key) { // original is an object
161+
forContext.rawValue[scope.$key] = value
162+
} else {
163+
forContext.rawValue.$set(scope.$index, value)
164+
}
165+
})
164166
}
165167
}
166168

0 commit comments

Comments
 (0)