Skip to content

anonyhostvn/conform-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Form-awesome

✨ Feature

- Fast building form with file config

🖥 Environment Support

- Modern browsers and Internet Explorer 9+
- Server-side Rendering
- [Electron](http://electron.atom.io/)

📦 Install

🔨 Usage

Config File

import {Input} from "antd";
import { inputFieldsType} from "../formEngine";

export const inputFields : inputFieldsType = [
    {
        size: 12,
        key: 'name',
        Element: Input,
        propsElement: {},
        fieldDecorator: {
            rules: [
                {
                    required: true,
                    message: 'Must fill this field'
                }
            ]
        }
    },
    {
        size: 12,
        key: 'userName',
        Element: Input,
        propsElement: {},
        fieldDecorator: {}
    }
];

Code

    <FormEngine
        formName={formName}
        inputFields={inputFields}
        dataSource={info}
        onFieldChangeFunc={(listFieldChanged) =>
            listFieldChanged.forEach((temp) => {
                setInfo({
                    ...info,
                    [temp.key]: temp.value
                });
        })}
        onSubmit={(data: Object) => console.error(data)}
        wrappedComponentRef={formRef}
    />

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published