vue-vben-admin Table的searchForm里的select onChange事件调用formActionType.submit()失败

rt4zxlrg  于 2023-02-04  发布在  Mac
关注(0)|答案(4)|浏览(784)

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs .
  • Make sure the code is up to date. (Some bugs have been fixed in the latest code)
  • This is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Describe the bug

Table的searchForm里的select onChange事件调用formActionType.submit()失败

{
    field: 'investType',
    label: '',
    component: 'Select',
    componentProps: ({ formActionType }) => ({
      allowClear: true,
      placeholder: '交易来源',
      options: allOptions.invest_type,
      onChange: () => {
        formActionType.submit();
      },
   }),
}

bsxbgnwa

bsxbgnwa1#

需要自定义submitFunc

u4vypkhs

u4vypkhs2#

onChange: () => { nextTick(() => { formActionType.submit(); }); },
亲测可用

hujrc8aj

hujrc8aj3#

我也遇到这个问题....自定义submitFunc 不会自动提交搜索的表单...进入死循环

ou6hu8tu

ou6hu8tu4#

@wangmin0314 你解决了?
自定义submitFunc 会陷入死循环

submitFunc: handleSubmit,
async function handleSubmit() {
      const values = getForm().getFieldsValue();

      getForm().submit();

      console.log(values);
    }

不知道是我写的不对?
getForm().submit();

相关问题