Skip to content

Commit 44e6da1

Browse files
committed
fix(runtime-dom): unref when setting useCssVars
1 parent 9b5ff2b commit 44e6da1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/runtime-dom/src/helpers/useCssVars.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
watchEffect,
66
warn,
77
VNode,
8-
Fragment
8+
Fragment,
9+
unref
910
} from '@vue/runtime-core'
1011
import { ShapeFlags } from '@vue/shared/src'
1112

@@ -45,7 +46,7 @@ function setVarsOnVNode(
4546
if (vnode.shapeFlag & ShapeFlags.ELEMENT && vnode.el) {
4647
const style = vnode.el.style
4748
for (const key in vars) {
48-
style.setProperty(`--${prefix}${key}`, vars[key])
49+
style.setProperty(`--${prefix}${key}`, unref(vars[key]))
4950
}
5051
} else if (vnode.type === Fragment) {
5152
;(vnode.children as VNode[]).forEach(c => setVarsOnVNode(c, vars, prefix))

0 commit comments

Comments
 (0)