]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-vapor): invoke getter for static attrs
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Thu, 14 Nov 2024 15:59:37 +0000 (23:59 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Thu, 14 Nov 2024 15:59:37 +0000 (23:59 +0800)
packages/runtime-vapor/src/apiCreateComponent.ts
packages/runtime-vapor/src/componentAttrs.ts

index cb7580038165089c12cfe1ea709801cd4fe15389..581a86079ac5e7926e46b14fd9c54089b8bb88ea 100644 (file)
@@ -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
index ce0ad86ca475c28d8b8d379727aa63e72b2365bd..7f646546fee5b123a54b6e041d62a80f4ec3672c 100644 (file)
@@ -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, {