0.0.14 • Published 2 years ago

@mitod/rh-forms v0.0.14

Weekly downloads
10
License
-
Repository
-
Last release
2 years ago

说明

使用

const initialValues = {
  code: {
    initValue: '',
    rules: [
      {
        required: true,
        pattern: CONST_REGEXS.str6,
        message: '激活码不能为空',
      },
    ],
  },
};

const { getFieldProps, errors } = useForms(initialValues);

const onSubmit = ()=>{
  // some code
}
const options = {
  trigger:'onChangText' // default onChange
}

<Input {...getFieldProps('code')}></Input>

<Button {...getSubmitButtonProps(onSubmit, options)}/>

initialValues

validate配置

errors

异常错误

getFieldProps

表单校验

0.0.13

2 years ago

0.0.14

2 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago