Skip to content

Commit d0523da

Browse files
authored
fix(useCssVar): Replace getComputedStyle with direct style property access (#4166)
1 parent acce3bb commit d0523da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/useCssVar/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export function useCssVar(
5252
watch(
5353
[elRef, () => toValue(prop)],
5454
(_, old) => {
55-
if (old[0] && old[1] && window)
56-
window.getComputedStyle(old[0]).removeProperty(old[1])
55+
if (old[0] && old[1])
56+
old[0].style.removeProperty(old[1])
5757
updateCssVar()
5858
},
5959
{ immediate: true },

0 commit comments

Comments
 (0)