fix: render dict

pull/7/head
xingyu 2023-05-04 16:17:54 +08:00
parent 3ed4174aad
commit 30065de533
2 changed files with 3 additions and 3 deletions

View File

@ -51,11 +51,11 @@ export default defineComponent({
return null return null
} }
// //
if (props.value === undefined) { if (props.value === undefined && props.value !== null) {
return null return null
} }
getDictObj(props.type, props.value.toString()) getDictObj(props.type, props.value.toString())
// && isHexColor(dictData.value?.cssClass) // && isHexColor(dictData.value?.cssClass)
return ( return (
<Tag <Tag
color={ color={

View File

@ -94,7 +94,7 @@ export const useRender = {
*/ */
renderDict: (text, type, dictType?) => { renderDict: (text, type, dictType?) => {
if (type) { if (type) {
return h(DictTag, { type: type, value: text || '', dictType: dictType || 'number' }) return h(DictTag, { type: type, value: text !== null ? text : '', dictType: dictType || 'number' })
} }
return '' return ''
}, },