|
|
@@ -398,9 +398,11 @@ export function createHydrationFunctions(
|
|
|
parentComponent.vnode.props.appear
|
|
|
|
|
|
const content = (el as HTMLTemplateElement).content
|
|
|
- .firstChild as Element
|
|
|
+ .firstChild as Element & { $cls?: string }
|
|
|
|
|
|
if (needCallTransitionHooks) {
|
|
|
+ const cls = content.getAttribute('class')
|
|
|
+ if (cls) content.$cls = cls
|
|
|
transition!.beforeEnter(content)
|
|
|
}
|
|
|
|
|
|
@@ -786,7 +788,7 @@ export function createHydrationFunctions(
|
|
|
* Dev only
|
|
|
*/
|
|
|
function propHasMismatch(
|
|
|
- el: Element,
|
|
|
+ el: Element & { $cls?: string },
|
|
|
key: string,
|
|
|
clientValue: any,
|
|
|
vnode: VNode,
|
|
|
@@ -799,7 +801,12 @@ function propHasMismatch(
|
|
|
if (key === 'class') {
|
|
|
// classes might be in different order, but that doesn't affect cascade
|
|
|
// so we just need to check if the class lists contain the same classes.
|
|
|
- actual = el.getAttribute('class')
|
|
|
+ if (el.$cls) {
|
|
|
+ actual = el.$cls
|
|
|
+ delete el.$cls
|
|
|
+ } else {
|
|
|
+ actual = el.getAttribute('class')
|
|
|
+ }
|
|
|
expected = normalizeClass(clientValue)
|
|
|
if (!isSetEqual(toClassSet(actual || ''), toClassSet(expected))) {
|
|
|
mismatchType = MismatchTypes.CLASS
|