【发布时间】:2018-02-21 16:34:03
【问题描述】:
我使用了这个插件Angular Schema Form,所有的东西都按预期工作,但是对于图像上传,我需要进行验证,以便允许用户只输入图像。
虽然架构在图片上传的属性中包含 accept 属性,如下所示:
{
"type": "object",
"properties": {
"text1": {
"type": "string",
"title": "Untitled Text field",
"name": "text1",
"url": "http://localhost/image/upload/img59b7c29f1622b.jpeg"
},
"file2": {
"type": "object",
"format": "file",
"title": "Untitled image upload field",
"x-schema-form": {
"type": "file",
"accept": "png|jpg|jpeg|gif"
},
"name": "file2"
}
},
"image": ["text1"]}
验证仍然没有发生,我可以选择任何文件。
【问题讨论】:
标签: javascript angularjs validation image-upload angular-schema-form