feat: render

pull/4/MERGE
xingyu 2023-03-29 23:57:37 +08:00
parent fae8ef469f
commit b568d4ca99
1 changed files with 8 additions and 0 deletions

View File

@ -13,10 +13,13 @@ export const useRender = {
width: 80 width: 80
}) })
} }
return ''
}, },
renderText: (text, val) => { renderText: (text, val) => {
if (text) { if (text) {
return text + ' ' + val return text + ' ' + val
} else {
return ''
} }
}, },
renderTag: (text, color?) => { renderTag: (text, color?) => {
@ -34,8 +37,12 @@ export const useRender = {
}) })
]) ])
} }
return ''
}, },
renderDate: (text, format?) => { renderDate: (text, format?) => {
if (!text) {
return ''
}
if (!format) { if (!format) {
return dayjs(text).format('YYYY-MM-DD HH:mm:ss') return dayjs(text).format('YYYY-MM-DD HH:mm:ss')
} else { } else {
@ -50,5 +57,6 @@ export const useRender = {
dictType: dictType || 'number' dictType: dictType || 'number'
}) })
} }
return ''
} }
} }