Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hooks): useTable supports passing in the default transformer clo… #598

Closed
wants to merge 2 commits into from

Conversation

Azir-11
Copy link
Member

@Azir-11 Azir-11 commented Aug 13, 2024

支持useTable传入transformer,未传入时使用自带的默认transformer

@Azir-11
Copy link
Member Author

Azir-11 commented Aug 13, 2024

close #595

* @param res the response data
* @returns the transformed data
*/
transformer?: (res: Awaited<ReturnType<A>>) => { data: any[]; pageNum: number; pageSize: number; total: number };
Copy link
Member

@honghuangdc honghuangdc Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我本地试了下,自定义的transformer的类型还不好处理

@@ -26,7 +26,7 @@ declare namespace NaiveUI {

type TableColumn<T> = TableColumnWithKey<T> | DataTableSelectionColumn<T> | DataTableExpandColumn<T>;

type TableApiFn<T = any, R = Api.SystemManage.CommonSearchParams> = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先单独提这个修复吧

@Azir-11 Azir-11 closed this Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants