mirror of https://github.com/vuejs/core.git
fix(runtime-vapor): invoke getter for static attrs
This commit is contained in:
parent
af75b64b40
commit
7a98f4b565
|
@ -12,7 +12,7 @@ import {
|
|||
walkRawProps,
|
||||
} from './componentProps'
|
||||
import { type RawSlots, isDynamicSlotFn } from './componentSlots'
|
||||
import { setInheritAttrs, withAttrs } from './componentAttrs'
|
||||
import { withAttrs } from './componentAttrs'
|
||||
import { isString } from '@vue/shared'
|
||||
import { renderEffect } from './renderEffect'
|
||||
import { normalizeBlock } from './dom/element'
|
||||
|
@ -90,7 +90,7 @@ function fallbackComponent(
|
|||
}
|
||||
|
||||
if (singleRoot) {
|
||||
setInheritAttrs(true)
|
||||
instance.dynamicAttrs = true
|
||||
}
|
||||
|
||||
return el
|
||||
|
|
|
@ -60,7 +60,13 @@ export function patchAttrs(
|
|||
|
||||
if (key === 'class' || key === 'style') {
|
||||
;(key === 'class' ? classes : styles).push(
|
||||
hasDynamicProps ? (getter ? value : () => value) : value,
|
||||
hasDynamicProps
|
||||
? getter
|
||||
? value
|
||||
: () => value
|
||||
: getter
|
||||
? value()
|
||||
: value,
|
||||
)
|
||||
} else if (getter) {
|
||||
Object.defineProperty(attrs, key, {
|
||||
|
|
Loading…
Reference in New Issue