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

Invalid prop: type check failed for prop "onClick". Expected Function, got Array #3358

Closed
xxbsxy opened this issue Nov 29, 2023 · 4 comments
Closed

Comments

@xxbsxy
Copy link

xxbsxy commented Nov 29, 2023

加上后 resetButtonOptions: {
onClick: () => {
reset();
},
},
会报警告
chunk-VNIXZ35R.js?v=e367aa2c:1665 [Vue warn]: Invalid prop: type check failed for prop "onClick". Expected Function, got Array

@wangjue666
Copy link
Collaborator

@xxbsxy 贴你的完整复现

@xxbsxy
Copy link
Author

xxbsxy commented Nov 30, 2023

@wangjue666 我的BasicForm 放在的BasicTable的插槽中 我需要手动重写reset方法 但是一直抛出警告
Invalid prop: type check failed for prop "onClick". Expected Function, got Array

  <template #tableTitle>
    <BasicForm @register="registerForm" :schemas="searchFormSchema" />
  </template>

const { tableContext } = useListPage({
designScope: 'use-equip',
tableProps: {
api: getBussinessList,
showIndexColumn: true,
resizeHeightOffset: 20,
rowKey: 'id',
useSearchForm: false,
beforeFetch(params) {
params.bussinessType = bussinessType;

    const values = getFieldsValue();
    for (const key in values) {
      params[key] = values[key];
    }

    if (params.bussinessType == 'allocate') {
      params.userId = userId;
    }

    params.orgId = orgId;

    if (params.examineState == 'all') {
      params.examineState = '';
    }

    if (params.allocateType == 'all') {
      params.allocateType = '';
    }

    return params;
  },
  actionColumn: {
    width: actionWidth,
    dataIndex: 'action',
    fixed: 'right',
  },
},

});

const reset = async () => {
await resetFields();
await nextTick();
await reload({ page: 1 });
};

const [registerForm, { getFieldsValue, setFieldsValue, resetFields }] = useForm({
resetButtonOptions: {
onClick: () => {
reset();
},
},
submitFunc() {
return reload({ page: 1 });
},
});

@sugar258596
Copy link

@xxbsxy 贴个图

@anncwb
Copy link
Collaborator

anncwb commented Apr 9, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@anncwb anncwb added the Stale label Apr 9, 2024
@anncwb anncwb closed this as completed Apr 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants