mirror of
https://github.com/vuejs/vue.git
synced 2024-11-21 20:28:54 +00:00
fix: detect property add/deletion on reactive objects from setup when used in templates
This commit is contained in:
parent
98fb01c79c
commit
a6e74985cf
@ -119,7 +119,16 @@ export function proxyWithRefUnwrap(
|
||||
Object.defineProperty(target, key, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: () => unref(source[key]),
|
||||
get: () => {
|
||||
const val = source[key]
|
||||
if (isRef(val)) {
|
||||
return val.value
|
||||
} else {
|
||||
const ob = val && val.__ob__
|
||||
if (ob) ob.dep.depend()
|
||||
return val
|
||||
}
|
||||
},
|
||||
set: value => {
|
||||
const oldValue = source[key]
|
||||
if (isRef(oldValue) && !isRef(value)) {
|
||||
|
Loading…
Reference in New Issue
Block a user