Skip to content

Commit 67c65af

Browse files
committed
fix(styled): improve element type check in removeStyleWithTransition function(#54)
1 parent e165da5 commit 67c65af

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/core/src/styled.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ function removeStyleWithTransition(className: string): void {
113113

114114
nextTick(() => {
115115
const el = instance.vnode.el as HTMLElement
116-
if (!el) {
116+
if (!el || !(el instanceof Element)) {
117117
removeStyle(className)
118118
return
119119
}
120120

121-
// 检查元素是否有 transition 样式
122121
const computedStyle = window.getComputedStyle(el)
123122
const transitionDuration = computedStyle.transitionDuration
124123
const transitionProperty = computedStyle.transitionProperty

0 commit comments

Comments
 (0)