fix: dict tag

pull/12/head
xingyu 2023-05-11 10:24:14 +08:00
parent cfd4ac840e
commit c4d3b3efff
1 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,9 @@ export default defineComponent({
} else {
dictOptions = getDictOptions(dictType)
}
if (dictOptions && dictOptions.length === 0) {
return
}
dictOptions.forEach((dict: DictDataType) => {
if (dict.value === value) {
if (dict.colorType + '' === 'primary') {
@ -49,6 +52,10 @@ export default defineComponent({
return null
}
getDictObj(props.type, props.value.toString())
if (dictData.value === undefined) {
return null
}
// && isHexColor(dictData.value?.cssClass)
return (
<Tag
@ -60,7 +67,7 @@ export default defineComponent({
: ''
}
>
{dictData.value?.label}
{dictData.value?.label || ''}
</Tag>
)
}