ant-design-vue/components/vc-form/src/createForm.jsx

35 lines
1.1 KiB
Vue
Raw Normal View History

2019-01-12 03:33:27 +00:00
import createBaseForm from './createBaseForm';
2018-05-02 13:35:42 +00:00
export const mixin = {
2018-05-03 11:10:43 +00:00
methods: {
2019-01-12 03:33:27 +00:00
getForm() {
2018-05-03 11:10:43 +00:00
return {
getFieldsValue: this.fieldsStore.getFieldsValue,
getFieldValue: this.fieldsStore.getFieldValue,
getFieldInstance: this.getFieldInstance,
setFieldsValue: this.setFieldsValue,
setFields: this.setFields,
setFieldsInitialValue: this.fieldsStore.setFieldsInitialValue,
getFieldDecorator: this.getFieldDecorator,
getFieldProps: this.getFieldProps,
getFieldsError: this.fieldsStore.getFieldsError,
getFieldError: this.fieldsStore.getFieldError,
isFieldValidating: this.fieldsStore.isFieldValidating,
isFieldsValidating: this.fieldsStore.isFieldsValidating,
isFieldsTouched: this.fieldsStore.isFieldsTouched,
isFieldTouched: this.fieldsStore.isFieldTouched,
isSubmitting: this.isSubmitting,
submit: this.submit,
validateFields: this.validateFields,
resetFields: this.resetFields,
2019-01-12 03:33:27 +00:00
};
2018-05-03 11:10:43 +00:00
},
2018-05-02 13:35:42 +00:00
},
2019-01-12 03:33:27 +00:00
};
2018-05-02 13:35:42 +00:00
2019-01-12 03:33:27 +00:00
function createForm(options) {
return createBaseForm(options, [mixin]);
2018-05-02 13:35:42 +00:00
}
2019-01-12 03:33:27 +00:00
export default createForm;