How can I add required validation on filepond vue?

别等时光非礼了梦想. 提交于 2020-02-26 03:42:25

问题


I read on this docs : https://github.com/pqina/vue-filepond

I try to add like this :

<FilePond 
    allowMultiple="true"
    accepted-file-types="image/jpg, image/jpeg, application/pdf"
    maxFileSize="2MB"
    required="true"/>

multiple, validation file type, max file works

But, required does not works

How can I solve this problem guys?


回答1:


Using the v-bind:required prop works:

<form method="post" action="">
    <file-pond v-bind:required="true"/>
    <button type="submit">submit</button>
</form>

Related GitHub issue: https://github.com/pqina/vue-filepond/issues/138



来源:https://stackoverflow.com/questions/60219552/how-can-i-add-required-validation-on-filepond-vue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!