Comments (5)
Sorry,I didn't understand what you mean. You can manually submit the form via $f.submit
. When the form is verified, the onSubmit
method can be triggered.
from form-create.
@xaboy, in my component file, I have a method add
, which I use to update the entity to the API. I would like to call this method from within onSubmit
.
export default {
name: 'BrandList',
mounted: async function () {
this.model = this.fApi.model()
},
methods: {
add(entity) {
// call API to insert
}
},
data () {
return {
fApi: {},
model: {},
option: {
onSubmit: function (formData) {
this.add(formData)
}
},
from form-create.
export default {
name: 'BrandList',
mounted: async function () {
this.model = this.fApi.model()
},
methods: {
add(entity) {
// call API to insert
}
},
data () {
const vm = this
return {
fApi: {},
model: {},
option: {
onSubmit: function (formData) {
vm.add(formData)
}
},
from form-create.
@xaboy , great thanks!
Another question: I see you use $f
throughout your docs and examples. But, I can't find where or how to define $f
.
from form-create.
$f
is the instance object returned by form-create
,you can refer to here
http://form-create.com/en/guide/instance.html
from form-create.
Related Issues (20)
- 考虑支持ant-design-vue4.0及以上的版本吗? HOT 3
- 怎么能接收自定义组件中的$emit事件 HOT 1
- Antv的Slider组件不支持范围选择 HOT 1
- naive-ui树形控件不可选中 HOT 2
- 【bug】vue2文档挂了 HOT 2
- group数组组件无法获取以及更新group中的规则
- 快速上手案例不显示表单 HOT 2
- 使用json构造动态表单,如何设置control和update这些函数? HOT 2
- 下拉选校验 HOT 3
- 希望新增配置去掉单行外层el-col HOT 3
- 提交前生成JSON时能否隐藏部分不需要的属性 HOT 1
- 二开过的elementplus组件库,框架不想引入两个组件库,能否提供配置项用于修改依赖指向
- 日期选择框问题 HOT 2
- MonthPicker 使用getValue值错误
- FormCreate + ArcoDesign DatePicker组件props type为datetimerange没有效果 HOT 2
- vue3 element-plus 全局方法 window.formCreate.create HOT 1
- vue3 如何销毁表单 HOT 1
- Vue2 双向绑定修改数据不生效 HOT 2
- 无
- 获取表单数据,control显示出来的表单数据顺序不对
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.