@@ -14,6 +14,7 @@ import VNode from './vnode'
14
14
import config from '../config'
15
15
import { SSR_ATTR } from 'shared/constants'
16
16
import { registerRef } from './modules/ref'
17
+ import { traverse } from '../observer/traverse'
17
18
import { activeInstance } from '../instance/lifecycle'
18
19
import { isTextInputType } from 'web/util/element'
19
20
@@ -534,7 +535,9 @@ export function createPatchFunction (backend) {
534
535
let hydrationBailed = false
535
536
// list of modules that can skip create hook during hydration because they
536
537
// are already rendered on the client or has no need for initialization
537
- const isRenderedModule = makeMap ( 'attrs,style,class,staticClass,staticStyle,key' )
538
+ // Note: style is excluded because it relies on initial clone for future
539
+ // deep updates (#7063).
540
+ const isRenderedModule = makeMap ( 'attrs,class,staticClass,staticStyle,key' )
538
541
539
542
// Note: this is a browser-only function so we can assume elms are DOM nodes.
540
543
function hydrate ( elm , vnode , insertedVnodeQueue , inVPre ) {
@@ -611,12 +614,18 @@ export function createPatchFunction (backend) {
611
614
}
612
615
}
613
616
if ( isDef ( data ) ) {
617
+ let fullInvoke = false
614
618
for ( const key in data ) {
615
619
if ( ! isRenderedModule ( key ) ) {
620
+ fullInvoke = true
616
621
invokeCreateHooks ( vnode , insertedVnodeQueue )
617
622
break
618
623
}
619
624
}
625
+ if ( ! fullInvoke && data [ 'class' ] ) {
626
+ // ensure collecting deps for deep class bindings for future updates
627
+ traverse ( data [ 'class' ] )
628
+ }
620
629
}
621
630
} else if ( elm . data !== vnode . text ) {
622
631
elm . data = vnode . text
0 commit comments