fix(reactivity): should delete observe value (#598)

fix #597
This commit is contained in:
likui
2020-01-14 06:11:49 +08:00
committed by Evan You
parent 30aae0b4df
commit 63a6563106
5 changed files with 60 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ function add(this: SetTypes, value: unknown) {
function set(this: MapTypes, key: unknown, value: unknown) {
value = toRaw(value)
key = toRaw(key)
const target = toRaw(this)
const proto = getProto(target)
const hadKey = proto.has.call(target, key)
@@ -87,6 +88,7 @@ function set(this: MapTypes, key: unknown, value: unknown) {
}
function deleteEntry(this: CollectionTypes, key: unknown) {
key = toRaw(key)
const target = toRaw(this)
const proto = getProto(target)
const hadKey = proto.has.call(target, key)