vue-vben-admin
vue-vben-admin copied to clipboard
Invalid prop: type check failed for prop "onClick". Expected Function, got Array
加上后 resetButtonOptions: { onClick: () => { reset(); }, }, 会报警告 chunk-VNIXZ35R.js?v=e367aa2c:1665 [Vue warn]: Invalid prop: type check failed for prop "onClick". Expected Function, got Array
@xxbsxy 贴你的完整复现
@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 }); }, });
@xxbsxy 贴个图
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