@peajs/form-antd
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@peajs/form-antd

Use Ant Design with @peajs/form

Installation

npm i @peajs/form-antd

Quickstart

import React from 'react'
import { Input } from 'antd'
import { useForm, Form, Item } from '@peajs/form-antd'

class User {
  username = 'foo'
  password = ''
}

export default () => {
  const result = useForm(User, {
    onSubmit(values) {
      console.log('values:', values)
    },
  })

  return (
    <Form use={result}>
      <Item name="username">
        <Input />
      </Item>
      <Item name="password">
        <Input />
      </Item>
      <button type="submit">Submit</button>
    </Form>
  )
}

License

MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i @peajs/form-antd

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

9.15 kB

Total Files

14

Last publish

Collaborators

  • forsigner