Merge pull request #72 from Mister-Kin/master

fix: failed to render for Boolean type of DictTag
pull/495/head
芋道源码 2024-08-13 22:55:58 +08:00 committed by GitHub
commit f45c255073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import { defineComponent, PropType, computed } from 'vue'
import { isHexColor } from '@/utils/color' import { isHexColor } from '@/utils/color'
import { ElTag } from 'element-plus' import { ElTag } from 'element-plus'
import { DictDataType, getDictOptions } from '@/utils/dict' import { DictDataType, getDictOptions } from '@/utils/dict'
import { isArray, isString, isNumber } from '@/utils/is' import { isArray, isString, isNumber, isBoolean } from '@/utils/is'
export default defineComponent({ export default defineComponent({
name: 'DictTag', name: 'DictTag',
@ -29,8 +29,8 @@ export default defineComponent({
}, },
setup(props) { setup(props) {
const valueArr: any = computed(() => { const valueArr: any = computed(() => {
// 1.Number // 1.NumberBoolean
if (isNumber(props.value)) { if (isNumber(props.value) || isBoolean(props.value)) {
return [String(props.value)] return [String(props.value)]
} }
// 2. -> props.sepSymbol // 2. -> props.sepSymbol