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

Table组件类型问题:关于TableRowSelection<T>接口里依然使用Object类型 #13761

Closed
1 task
hahabazinga opened this issue Dec 21, 2018 · 1 comment
Closed
1 task

Comments

@hahabazinga
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

在table/interface.d.ts文件中:

export interface TableRowSelection<T> {
    type?: RowSelectionType;
    selectedRowKeys?: string[] | number[];
    onChange?: (selectedRowKeys: string[] | number[], selectedRows: Object[]) => void;
    getCheckboxProps?: (record: T) => Object;
    onSelect?: SelectionSelectFn<T>;
    onSelectMultiple?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => void;
    onSelectAll?: (selected: boolean, selectedRows: Object[], changeRows: Object[]) => void;
    onSelectInvert?: (selectedRows: Object[]) => void;
    selections?: SelectionItem[] | boolean;
    hideDefaultSelections?: boolean;
    fixed?: boolean;
    columnWidth?: string | number;
    selectWay?: TableSelectWay;
    columnTitle?: string | React.ReactNode;
}

TableRowSelection已经有范型参数,但是onChange的参数类型声明中selectRows依然声明为Object[], 这里是出于什么考虑呢?

What does the proposed API look like?

改成和T关联是不是好一点,比如Array或者extends T类似的?

@afc163
Copy link
Member

afc163 commented Dec 21, 2018

没啥特别考虑,欢迎 PR

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

No branches or pull requests

3 participants