Comments (16)
上传图片没有表单验证,你想验证什么?
from form-create.
就是验证必须上传
from form-create.
validate : [ {
required : required,
message : "请上传" + title,
trigger : 'blur'
} ]
from form-create.
我这样写的,但是上传之后依旧要我上传图片,验证没有通过
from form-create.
上传组件的验证确实存在问题,这个问题下个版本会修复。目前不建议的上传组件中使用验证
from form-create.
请问可以有展示替代的办法吗
from form-create.
可以在表单提交的时候单独判断一下,这样确实比较笨拙。抱歉,下个版本一定修复。
onSubmit:()=>{
//maxLength= 1 value为String
if(!$f.getValue('uploadField')){
//TODO 没有上传图片
return false;
}
//maxLength > 1 value为Array
if(!$f.getValue('uploadField').length){
//TODO 没有上传图片
return false;
}
}
from form-create.
非常感谢
from form-create.
validateField(field,callback) 请问是否可以使用这个方法替代呢
from form-create.
不行,这个还是根据validate规则验证的
from form-create.
好的,明白了,谢谢
from form-create.
trigger 请问一下,这个参数是做什么的
from form-create.
{ required: true,type:'array', message: '请选择标签', trigger: 'change' }请问其中的type:‘array’在哪些类型会用到
from form-create.
是触发验证的方式
详细参考这里https://github.com/yiminghe/async-validator
from form-create.
谢谢
from form-create.
1.2.2 办法已发布,已修复上传组件验证问题
from form-create.
Related Issues (20)
- 大佬,怎么向自定义组件中传值并且自定义组件能接收到。 HOT 2
- package.json 中 "bili": "cross-env bili" 这个是啥意思?
- 自定义组件的表单验证,清空自定义组件的值,需要点击提交才能显示必填提示 HOT 2
- 000 HOT 2
- 来自elementui 的radio 的warn HOT 2
- import
- 在ElMessageBox中使用h函数使用FormCreate,element-ui 是不是不能使用autoimport?
- 表单提交问题 HOT 2
- 兼容问题 HOT 2
- info 需要更加灵活的配置 HOT 1
- 多组件联合联动,组件一的值+组合二的值 控制显示不同组件 如何弄 HOT 2
- 数组组件如何修改字段 HOT 2
- Select组件使用Effect获取数据后,在Update中无法获取Options HOT 2
- fApi.getRule is not a function HOT 1
- 有没有配置在提交数据时不获取field对应的值 HOT 1
- 如果一个对象是一个MAP, 键值都不知道, 这个时候他的RULE要怎么定义 HOT 2
- 文档官网打不开了 HOT 2
- adv@4 版本,type为textarea 时,fApi.resetFields()无效 HOT 2
- FormCreate放到 a-modal 弹框中时,resetFields 无效
- 拖拽失效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form-create.