From 14192991d97370651e8e13d4565788530b5792e3 Mon Sep 17 00:00:00 2001 From: "Mr. Kin" Date: Tue, 13 Aug 2024 10:28:55 +0800 Subject: [PATCH] fix: failed to render for Boolean type of DictTag --- src/components/DictTag/src/DictTag.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue index f84a47cb..57acb628 100644 --- a/src/components/DictTag/src/DictTag.vue +++ b/src/components/DictTag/src/DictTag.vue @@ -3,7 +3,7 @@ import { defineComponent, PropType, computed } from 'vue' import { isHexColor } from '@/utils/color' import { ElTag } from 'element-plus' import { DictDataType, getDictOptions } from '@/utils/dict' -import { isArray, isString, isNumber } from '@/utils/is' +import { isArray, isString, isNumber, isBoolean } from '@/utils/is' export default defineComponent({ name: 'DictTag', @@ -29,8 +29,8 @@ export default defineComponent({ }, setup(props) { const valueArr: any = computed(() => { - // 1.是Number类型的情况 - if (isNumber(props.value)) { + // 1.是Number类型和Boolean类型的情况 + if (isNumber(props.value) || isBoolean(props.value)) { return [String(props.value)] } // 2.是字符串(进一步判断是否有包含分隔符号 -> props.sepSymbol )