@@ -43,9 +43,9 @@ onMounted(() => {
4343
4444 watch (
4545 () => [props .revision , props .state ],
46- (value ) => {
47- if (typeof value !== ' number' && typeof value !== ' string' )
48- deepSync (value , props .state )
46+ ([ _ , state ] ) => {
47+ if (typeof state !== ' number' && typeof state !== ' string' )
48+ deepSync (state , props .state )
4949 else
5050 proxy .value = props .state
5151 },
@@ -54,15 +54,13 @@ onMounted(() => {
5454})
5555
5656function deepSync(from : any , to : any ) {
57- // const fromRevision = from[0]
58- const fromValue = from [1 ]
59- for (const key in fromValue ) {
60- if (Array .isArray (fromValue [key ]))
61- to [key ] = fromValue [key ].slice ()
62- else if (typeof fromValue [key ] === ' object' && fromValue [key ] !== null )
63- deepSync (fromValue [key ], to [key ])
57+ for (const key in from ) {
58+ if (Array .isArray (from [key ]))
59+ to [key ] = from [key ].slice ()
60+ else if (typeof from [key ] === ' object' && from [key ] !== null )
61+ deepSync (from [key ], to [key ])
6462 else
65- to [key ] = fromValue [key ]
63+ to [key ] = from [key ]
6664 }
6765}
6866
0 commit comments