Browse Source

fix: dict

main
xingyuv 2 years ago
parent
commit
f4bff0c836
  1. 3
      src/components/Table/src/hooks/useRender.ts
  2. 2
      src/utils/dict.ts

3
src/components/Table/src/hooks/useRender.ts

@ -50,9 +50,6 @@ export const useRender = {
} }
}, },
renderDict: (text, type, dictType?) => { renderDict: (text, type, dictType?) => {
if (!text) {
return ''
}
if (type) { if (type) {
return h(DictTag, { return h(DictTag, {
type: type, type: type,

2
src/utils/dict.ts

@ -68,7 +68,7 @@ export const getBoolDictOptions = (dictType: string) => {
export const getDictObj = (dictType: string, value: any) => { export const getDictObj = (dictType: string, value: any) => {
const dictOptions: DictDataType[] = getDictOptions(dictType) const dictOptions: DictDataType[] = getDictOptions(dictType)
if (dictOptions && dictOptions.length > 0) { if (dictOptions) {
dictOptions.forEach((dict: DictDataType) => { dictOptions.forEach((dict: DictDataType) => {
if (dict.value === value.toString()) { if (dict.value === value.toString()) {
return dict return dict