mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-02 03:34:59 +08:00
fix: failed to render for Boolean type of DictTag
This commit is contained in:
parent
a7c37fa295
commit
14192991d9
@ -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.是Number类型和Boolean类型的情况
|
||||||
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 )
|
||||||
|
Loading…
Reference in New Issue
Block a user