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 onchange 提示 need function not array #677

Closed
godaangel opened this issue May 30, 2021 · 2 comments
Closed

table onchange 提示 need function not array #677

godaangel opened this issue May 30, 2021 · 2 comments

Comments

@godaangel
Copy link

code

    const [registerTable, { reload, getColumns }] = useTable({
        showIndexColumn: false,
        columns: getBasicColumns(),
        onChange: (pagination: any, __: any, sorter: { [key: string]: string }) => {
        },
        ellipsis: false,
    });

warning:

[Vue warn]: Invalid prop: type check failed for prop "onChange". Expected Function, got Array
at <ATable ref="tableElRef" size="middle" customRow=fn ... >
at <BasicTable onRegister=fn dataSource= [{…}] >

version:
vben 2.3.0
ant-design-vue 2.1.6

@mynetfan
Copy link
Collaborator

注意,不能使用useTable来注册事件,useTable只可用来设置props。请直接将事件绑定在Template中的BasicTable节点上。如:
<BasicTable @register="registerTable" @change="onChange" />

@mynetfan
Copy link
Collaborator

9f5085c

此commit解决useTable无法注册onChange的问题。

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

2 participants