Comments (6)
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.
https://github.com/xaboy/form-builder/blob/master/src/Form.php#L409
js模板文件路径写死了 而且有的表单需要confirm有的不需要,作者能不能考虑加个动态的参数,比如beforeSubmit 函数什么的
from form-builder.
https://github.com/xaboy/form-builder/blob/master/src/Form.php#L443 这里可以修改模板
下个版本可以加个beforeSubmit
from form-builder.
好的,感谢回答。
from form-builder.
我试了下那个好像是form模板不是js模板 想修改formScript这个方法返回的js
from form-builder.
我知道了,可以吧js模板代码全复制到form模板里。
from form-builder.
Related Issues (20)
- select下拉选中后依旧提示未选中 HOT 1
- 有个需求,服务区域需要多选,不能用城市联动,请问有什么方法可以实现,谢谢 HOT 1
- select 单选值不是字符串的时候,选着会提示未选择 HOT 1
- 代码注释问题
- 控制其他组件显示问题 HOT 1
- 这个frame框架组件如何使用呢?
- trait EmitRule 这个特性类中的 emitPrefix 方法写错了吧?
- 官方文档居然不介绍组件默认值怎么设置? HOT 1
- 开启服务报错 HOT 2
- select组件如何定义remoteMethods HOT 1
- 两个问题
- 怎么修改提交按钮的样式
- 复选框怎么实现呢? HOT 1
- doctrine/annotations
- 多级联动组件Elm::cascader不支持多选
- 有没有vue3版本的呀
- 没有项目
- php8.2报错 HOT 1
- 什么时候能支持富文本?
- 强烈建议添加一个富文本的组件 HOT 1
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-builder.