File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed
packages/runtime/core/src Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -48,25 +48,17 @@ export const filterNestedConfig = (
48
48
return config ;
49
49
} ;
50
50
51
- // Merge `oldConfig` and `newConfig`
51
+ // `props` may be responsive data
52
52
export const deepMergeConfig = < T > ( o , n ) => {
53
- let tempO = o ;
54
- let tempN = n ;
55
- const oHasProps = o && hasOwn ( o , 'props' ) ;
56
- const nHasProps = n && hasOwn ( n , 'props' ) ;
57
-
58
- if ( oHasProps ) {
59
- tempO = Object . assign ( { } , o ) ;
60
- delete tempO . props ;
61
- }
62
- if ( nHasProps ) {
63
- tempN = Object . assign ( { } , n ) ;
64
- delete tempN . props ;
65
- }
66
- const result = deepMerge ( tempO , tempN ) ;
67
- if ( oHasProps || nHasProps ) {
68
- result . props = n . props || o . props ;
53
+ const props = n . props || o . props ;
54
+ if ( props ) {
55
+ o = { ...o } ;
56
+ n = { ...n } ;
57
+ delete o . props ;
58
+ delete n . props ;
69
59
}
60
+ const result = deepMerge ( o , n ) ;
61
+ if ( props ) result . props = props ;
70
62
return result as T ;
71
63
} ;
72
64
You can’t perform that action at this time.
0 commit comments