fix(runtime-dom): unref when setting useCssVars
This commit is contained in:
parent
9b5ff2b567
commit
44e6da1402
@ -5,7 +5,8 @@ import {
|
||||
watchEffect,
|
||||
warn,
|
||||
VNode,
|
||||
Fragment
|
||||
Fragment,
|
||||
unref
|
||||
} from '@vue/runtime-core'
|
||||
import { ShapeFlags } from '@vue/shared/src'
|
||||
|
||||
@ -45,7 +46,7 @@ function setVarsOnVNode(
|
||||
if (vnode.shapeFlag & ShapeFlags.ELEMENT && vnode.el) {
|
||||
const style = vnode.el.style
|
||||
for (const key in vars) {
|
||||
style.setProperty(`--${prefix}${key}`, vars[key])
|
||||
style.setProperty(`--${prefix}${key}`, unref(vars[key]))
|
||||
}
|
||||
} else if (vnode.type === Fragment) {
|
||||
;(vnode.children as VNode[]).forEach(c => setVarsOnVNode(c, vars, prefix))
|
||||
|
Loading…
Reference in New Issue
Block a user