File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
- import { Vue } from '../vue'
1
+ import { Vue , isVue3 } from '../vue'
2
2
import { cloneDeep } from './clone-deep'
3
3
import { looseEqual } from './loose-equal'
4
4
import { hasOwnProperty , keys } from './object'
@@ -16,11 +16,19 @@ export const makePropWatcher = propName => ({
16
16
}
17
17
for ( const key in oldValue ) {
18
18
if ( ! hasOwnProperty ( newValue , key ) ) {
19
- this . $delete ( this . $data [ propName ] , key )
19
+ if ( isVue3 ) {
20
+ delete this . $data [ propName ] [ key ]
21
+ } else {
22
+ this . $delete ( this . $data [ propName ] , key )
23
+ }
20
24
}
21
25
}
22
26
for ( const key in newValue ) {
23
- this . $set ( this . $data [ propName ] , key , newValue [ key ] )
27
+ if ( isVue3 ) {
28
+ this . $data [ propName ] [ key ] = newValue [ key ]
29
+ } else {
30
+ this . $set ( this . $data [ propName ] , key , newValue [ key ] )
31
+ }
24
32
}
25
33
}
26
34
} )
You can’t perform that action at this time.
0 commit comments