Coder Social home page Coder Social logo

Comments (6)

xaboy avatar xaboy commented on June 1, 2024
config.onSubmit = function (formData) {
            confirm('确认提交表单?');
            $f.submitBtnProps({loading: true, disabled: true});
            ajax(action, method, formData, function (status, res) {
                if (option.callback) return option.callback(status, res, $f);

                $f.submitBtnProps({loading: false, disabled: false});
                if (status && res.code === 200) {
                    vm.$Message.success(res.msg || '表单提交成功');
                } else {
                    vm.$Message.error(res.msg || '表单提交失败');
                }
            });
        };

from form-builder.

pgyf avatar pgyf commented on June 1, 2024

https://github.com/xaboy/form-builder/blob/master/src/Form.php#L409
js模板文件路径写死了 而且有的表单需要confirm有的不需要,作者能不能考虑加个动态的参数,比如beforeSubmit 函数什么的

from form-builder.

xaboy avatar xaboy commented on June 1, 2024

https://github.com/xaboy/form-builder/blob/master/src/Form.php#L443 这里可以修改模板
下个版本可以加个beforeSubmit

from form-builder.

pgyf avatar pgyf commented on June 1, 2024

好的,感谢回答。

from form-builder.

pgyf avatar pgyf commented on June 1, 2024

我试了下那个好像是form模板不是js模板 想修改formScript这个方法返回的js

from form-builder.

pgyf avatar pgyf commented on June 1, 2024

我知道了,可以吧js模板代码全复制到form模板里。

from form-builder.

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.