File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -174,17 +174,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
174174 receiver : object
175175 ) : boolean {
176176 let oldValue = ( target as any ) [ key ]
177- if ( isReadonly ( oldValue ) && isRef ( oldValue ) && ! isRef ( value ) ) {
178- return false
179- }
180177 if ( ! this . _shallow ) {
178+ const isOldValueReadonly = isReadonly ( oldValue )
181179 if ( ! isShallow ( value ) && ! isReadonly ( value ) ) {
182180 oldValue = toRaw ( oldValue )
183181 value = toRaw ( value )
184182 }
185183 if ( ! isArray ( target ) && isRef ( oldValue ) && ! isRef ( value ) ) {
186- oldValue . value = value
187- return true
184+ if ( isOldValueReadonly ) {
185+ return false
186+ } else {
187+ oldValue . value = value
188+ return true
189+ }
188190 }
189191 } else {
190192 // in shallow mode, objects are set as-is regardless of reactive or not
You can’t perform that action at this time.
0 commit comments