feat: 按钮组件可指定 icon 颜色
This commit is contained in:
parent
f1320b0221
commit
59a4a261bb
|
|
@ -89,6 +89,12 @@ const props = defineProps({
|
|||
type: String,
|
||||
required: false,
|
||||
default: '#FFFFFF',
|
||||
},
|
||||
//指定icon颜色
|
||||
customIconColor: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -102,6 +108,10 @@ const btnBgColor = computed(() => {
|
|||
|
||||
//计算 icon 颜色
|
||||
const iconColor = computed(() => {
|
||||
if (props.customIconColor) {
|
||||
return props.customIconColor
|
||||
}
|
||||
|
||||
if (!props.isActive) {
|
||||
return 'var(--descriptionColor)'
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user