fix : 修复tag组件
This commit is contained in:
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user