Skip to content

Commit

Permalink
fix: fix table column text display error
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhaocl1997 committed Apr 10, 2022
1 parent 7b44c55 commit 89dcb39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/UI/Table/src/components/settings/columns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@
return (item as TableBaseColumn).title
}
if (typeof (item as TableBaseColumn).title === 'function') {
// @ts-ignore
return item.title()
// @ts-expect-error
if (typeof item.titleText === 'function') {
// @ts-expect-error
return item.titleText()
}
return t('app:base:selection')
Expand Down
2 changes: 2 additions & 0 deletions src/components/UI/Table/src/hooks/useTableColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const useTableColumns = (
)}
</>
),
// this is used for column settings to display text correctly
titleText: () => getTableTranslated(props, item),
}
}

Expand Down

0 comments on commit 89dcb39

Please sign in to comment.