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

Bug: Vben Form 表单中使用Upload上传组件,当上传和删除后响应的fileList错误 #4882

Closed
5 tasks done
guodingfang opened this issue Nov 13, 2024 · 0 comments · Fixed by #4916
Closed
5 tasks done

Comments

@guodingfang
Copy link

Version

Vben Admin V5

Describe the bug?

表单中使用Upload上传组件,当change后响应的fileList错误

Reproduction

代码部分

const [Form, formApi] = useVbenForm({
  commonConfig: {
    componentProps: {
      class: 'w-5/6',
    },
  },
  handleSubmit: onSubmit,
  layout: 'horizontal',
  showDefaultActions: false,
  schema: [
    {
      component: 'Upload',
      componentProps: {
        listType: 'picture-card',
        maxCount: 1,
      },
      fieldName: 'avatar',
      label: '头像',
      renderComponentContent: () => {
        return {
          default: () => 'Upload',
        };
      },
    }
  ],
});

上传图片和删除图片前

image

上传图片和删除图片后

image

其他

另外想请教一下,如果在useVbenForm组件中,如何增加ant中的事件,例如图片阅览的preview、change事件等?

System Info

ant-design-vue.js?v=005a88ff:95007 Uncaught (in promise) TypeError: (intermediate value)(intermediate value)(intermediate value).map is not a function
    at Object.postState (ant-design-vue.js?v=005a88ff:95007:63)
    at ant-design-vue.js?v=005a88ff:15420:20
    at callWithErrorHandling (chunk-SYQBBRNQ.js?v=005a88ff:2008:19)
    at callWithAsyncErrorHandling (chunk-SYQBBRNQ.js?v=005a88ff:2015:17)
    at baseWatchOptions.call (chunk-SYQBBRNQ.js?v=005a88ff:7983:47)
    at ReactiveEffect.getter [as fn] (chunk-SYQBBRNQ.js?v=005a88ff:1688:25)
    at ReactiveEffect.run (chunk-SYQBBRNQ.js?v=005a88ff:227:19)
    at job (chunk-SYQBBRNQ.js?v=005a88ff:1747:15)
    at flushPreFlushCbs (chunk-SYQBBRNQ.js?v=005a88ff:2164:7)
    at updateComponentPreRender (chunk-SYQBBRNQ.js?v=005a88ff:7256:5)

Relevant log output

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant