mirror of
https://github.com/element-plus/element-plus.git
synced 2025-03-13 15:57:11 +08:00
refactor(icon): reduce getter access (#9360)
* Update icon.vue * Update icon.vue
This commit is contained in:
parent
954b8408af
commit
d4d411c936
@ -19,11 +19,12 @@ const props = defineProps(iconProps)
|
||||
const ns = useNamespace('icon')
|
||||
|
||||
const style = computed<CSSProperties>(() => {
|
||||
if (!props.size && !props.color) return {}
|
||||
const { size, color } = props
|
||||
if (!size && !color) return {}
|
||||
|
||||
return {
|
||||
fontSize: isUndefined(props.size) ? undefined : addUnit(props.size),
|
||||
'--color': props.color,
|
||||
fontSize: isUndefined(size) ? undefined : addUnit(size),
|
||||
'--color': color,
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user