fix(reactivity): mutating a readonly ref nested in a reactive object should fail. (#5048)
fix: #5042
This commit is contained in:
@@ -150,6 +150,9 @@ function createSetter(shallow = false) {
|
||||
receiver: object
|
||||
): boolean {
|
||||
let oldValue = (target as any)[key]
|
||||
if (isReadonly(oldValue) && isRef(oldValue)) {
|
||||
return false
|
||||
}
|
||||
if (!shallow && !isReadonly(value)) {
|
||||
if (!isShallow(value)) {
|
||||
value = toRaw(value)
|
||||
|
||||
Reference in New Issue
Block a user