|
@@ -33,12 +33,15 @@ export default defineComponent({
|
|
if (!props.type) {
|
|
if (!props.type) {
|
|
return null
|
|
return null
|
|
}
|
|
}
|
|
- if (!props.value) {
|
|
|
|
|
|
+ // 解决自定义字典标签值为零时标签不渲染的问题
|
|
|
|
+ if (!props.value && props.value !== 0) {
|
|
return null
|
|
return null
|
|
}
|
|
}
|
|
getDictObj(props.type, props.value.toString())
|
|
getDictObj(props.type, props.value.toString())
|
|
|
|
+ // 添加标签的文字颜色为白色,解决自定义背景颜色时标签文字看不清的问题
|
|
return (
|
|
return (
|
|
<ElTag
|
|
<ElTag
|
|
|
|
+ style={dictData.value?.cssClass ? 'color: #fff' : ''}
|
|
type={dictData.value?.colorType}
|
|
type={dictData.value?.colorType}
|
|
color={
|
|
color={
|
|
dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)
|
|
dictData.value?.cssClass && isHexColor(dictData.value?.cssClass)
|