@@ -14,6 +14,7 @@ import VNode from './vnode'
1414import config from '../config'
1515import { SSR_ATTR } from 'shared/constants'
1616import { registerRef } from './modules/ref'
17+ import { traverse } from '../observer/traverse'
1718import { activeInstance } from '../instance/lifecycle'
1819import { isTextInputType } from 'web/util/element'
1920
@@ -534,7 +535,9 @@ export function createPatchFunction (backend) {
534535 let hydrationBailed = false
535536 // list of modules that can skip create hook during hydration because they
536537 // 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' )
538541
539542 // Note: this is a browser-only function so we can assume elms are DOM nodes.
540543 function hydrate ( elm , vnode , insertedVnodeQueue , inVPre ) {
@@ -611,12 +614,18 @@ export function createPatchFunction (backend) {
611614 }
612615 }
613616 if ( isDef ( data ) ) {
617+ let fullInvoke = false
614618 for ( const key in data ) {
615619 if ( ! isRenderedModule ( key ) ) {
620+ fullInvoke = true
616621 invokeCreateHooks ( vnode , insertedVnodeQueue )
617622 break
618623 }
619624 }
625+ if ( ! fullInvoke && data [ 'class' ] ) {
626+ // ensure collecting deps for deep class bindings for future updates
627+ traverse ( data [ 'class' ] )
628+ }
620629 }
621630 } else if ( elm . data !== vnode . text ) {
622631 elm . data = vnode . text
0 commit comments