Browse Source

fix: dict tag

main
xingyu 2 years ago
parent
commit
c4d3b3efff
  1. 9
      src/components/DictTag/src/DictTag.vue

9
src/components/DictTag/src/DictTag.vue

@ -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>
)
}