enc-formscaffold
TypeScript icon, indicating that this package has built-in type declarations

0.0.30 • Public • Published

enc-formscaffold

NPM version NPM downloads

Install

$ npm install enc-formscaffold

Usage

git clone https://github.com/Oct-17/enc-formscaffold.git
npm install
npm run dev

## 在其他项目中使用
## 需要安装 antd5, react18

npm link your-path/enc-formscaffold

import useFormscaffold from 'enc-formscaffold';
import {Button} from "antd";

const Demo = () => {
  const [FormScaffold, {form, CHILD}] = useFormscaffold();

  return (<FormScaffold
    formProps={{
      // antd form props
    }}
    options={[
      {
        id: 'user',
        label: 'username',
        rules: ['req'],
        fieldProps: {
          // antd input props..
        }
      },
      {
        containerRender: (form) => <Button onClick={() => {
          /* form.xxx() */
        }}>click</Button>
      },
      {
        id: 'password',
        label: 'password',
        child: CHILD.PASSWORD,
        rules: ['req'],
        render: (props, form) => <input {...props} />
      },
    ]}
  />);
}

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i enc-formscaffold

Weekly Downloads

0

Version

0.0.30

License

MIT

Unpacked Size

29.6 kB

Total Files

25

Last publish

Collaborators

  • qq858854440