Skip to content

Commit ff68db4

Browse files
TerenceZyyx990803
authored andcommitted
fix(reactivity): avoid triggering effect when deleting property returns false (vuejs#168)
1 parent b9a4d8d commit ff68db4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/reactivity/src/baseHandlers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function deleteProperty(target: any, key: string | symbol): boolean {
7070
const hadKey = hasOwn(target, key)
7171
const oldValue = target[key]
7272
const result = Reflect.deleteProperty(target, key)
73-
if (hadKey) {
73+
if (result && hadKey) {
7474
/* istanbul ignore else */
7575
if (__DEV__) {
7676
trigger(target, OperationTypes.DELETE, key, { oldValue })

0 commit comments

Comments
 (0)