Giter Club home page Giter Club logo

Comments (16)

xaboy avatar xaboy commented on May 14, 2024

上传图片没有表单验证,你想验证什么?

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

就是验证必须上传

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

validate : [ {
required : required,
message : "请上传" + title,
trigger : 'blur'
} ]

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

我这样写的,但是上传之后依旧要我上传图片,验证没有通过

from form-create.

xaboy avatar xaboy commented on May 14, 2024

上传组件的验证确实存在问题,这个问题下个版本会修复。目前不建议的上传组件中使用验证

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

请问可以有展示替代的办法吗

from form-create.

xaboy avatar xaboy commented on May 14, 2024

可以在表单提交的时候单独判断一下,这样确实比较笨拙。抱歉,下个版本一定修复。

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.

williamBoss avatar williamBoss commented on May 14, 2024

非常感谢

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

validateField(field,callback) 请问是否可以使用这个方法替代呢

from form-create.

xaboy avatar xaboy commented on May 14, 2024

不行,这个还是根据validate规则验证的

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

好的,明白了,谢谢

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

trigger 请问一下,这个参数是做什么的

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

{ required: true,type:'array', message: '请选择标签', trigger: 'change' }请问其中的type:‘array’在哪些类型会用到

from form-create.

xaboy avatar xaboy commented on May 14, 2024

是触发验证的方式
详细参考这里https://github.com/yiminghe/async-validator

from form-create.

williamBoss avatar williamBoss commented on May 14, 2024

谢谢

from form-create.

xaboy avatar xaboy commented on May 14, 2024

1.2.2 办法已发布,已修复上传组件验证问题

from form-create.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.