fix : 修复tag组件

This commit is contained in:
2024-09-15 20:12:41 +08:00
parent af88e3cc93
commit aef2548b3d

View File

@@ -1,9 +1,9 @@
<template> <template>
<div class="tag-style"> <div class="tag-style">
<el-tag v-if="tagConfig.isType" :type="tagConfig.listClass" :effect="tagConfig.theme || 'plain'"> <el-tag v-if="tagConfig?.isType" :type="tagConfig?.listClass" :effect="tagConfig?.theme || 'plain'">
{{ filterDict(cacheStore.getDict(dictType), value) }} {{ filterDict(cacheStore.getDict(dictType), value) }}
</el-tag> </el-tag>
<el-tag v-else :color="tagConfig.listClass" :effect="tagConfig.theme || 'plain'" <el-tag v-else :color="tagConfig?.listClass" :effect="tagConfig?.theme || 'plain'"
:class="{'null-tag':filterDict(cacheStore.getDict(dictType), value)===undefined}"> :class="{'null-tag':filterDict(cacheStore.getDict(dictType), value)===undefined}">
{{ filterDict(cacheStore.getDict(dictType), value) }} {{ filterDict(cacheStore.getDict(dictType), value) }}
</el-tag> </el-tag>
@@ -45,7 +45,7 @@ const filterDict = (data, value) => {
tagConfig.value = data.find(item => item.value == value) tagConfig.value = data.find(item => item.value == value)
} }
} }
return tagConfig.value.label return tagConfig.value?.label || '未知'
} }
</script> </script>