mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-24 11:05:17 +08:00
fix(utils): type error (#7939)
This commit is contained in:
parent
af732b124b
commit
7e0f6d71a5
@ -51,7 +51,5 @@
|
||||
"packages/components/tree/",
|
||||
"packages/components/virtual-list/",
|
||||
"packages/components/visual-hidden/",
|
||||
"packages/directives/",
|
||||
"packages/utils/dom/",
|
||||
"packages/utils/vue/"
|
||||
"packages/directives/"
|
||||
]
|
||||
|
@ -35,12 +35,12 @@ export const getStyle = (
|
||||
let key = camelize(styleName)
|
||||
if (key === 'float') key = 'cssFloat'
|
||||
try {
|
||||
const style = element.style[styleName]
|
||||
const style = (element.style as any)[key]
|
||||
if (style) return style
|
||||
const computed = document.defaultView?.getComputedStyle(element, '')
|
||||
return computed ? computed[styleName] : ''
|
||||
const computed: any = document.defaultView?.getComputedStyle(element, '')
|
||||
return computed ? computed[key] : ''
|
||||
} catch {
|
||||
return element.style[styleName]
|
||||
return (element.style as any)[key]
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,8 +56,8 @@ export const setStyle = (
|
||||
setStyle(element, prop, value)
|
||||
)
|
||||
} else {
|
||||
const key = camelize(styleName)
|
||||
element.style[key] = value
|
||||
const key: any = camelize(styleName)
|
||||
element.style[key] = value as any
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user