File tree 1 file changed +4
-3
lines changed
packages/runtime-core/src
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -398,9 +398,10 @@ export function createHydrationFunctions(
398
398
parentComponent . vnode . props . appear
399
399
400
400
const content = ( el as HTMLTemplateElement ) . content
401
- . firstChild as Element
401
+ . firstChild as Element & { $cls : string | null }
402
402
403
403
if ( needCallTransitionHooks ) {
404
+ content . $cls = content . getAttribute ( 'class' )
404
405
transition ! . beforeEnter ( content )
405
406
}
406
407
@@ -786,7 +787,7 @@ export function createHydrationFunctions(
786
787
* Dev only
787
788
*/
788
789
function propHasMismatch (
789
- el : Element ,
790
+ el : Element & { $cls ?: string | null } ,
790
791
key : string ,
791
792
clientValue : any ,
792
793
vnode : VNode ,
@@ -799,7 +800,7 @@ function propHasMismatch(
799
800
if ( key === 'class' ) {
800
801
// classes might be in different order, but that doesn't affect cascade
801
802
// so we just need to check if the class lists contain the same classes.
802
- actual = el . getAttribute ( 'class' )
803
+ actual = el . $cls || el . getAttribute ( 'class' )
803
804
expected = normalizeClass ( clientValue )
804
805
if ( ! isSetEqual ( toClassSet ( actual || '' ) , toClassSet ( expected ) ) ) {
805
806
mismatchType = MismatchTypes . CLASS
You can’t perform that action at this time.
0 commit comments