Skip to content

Commit

Permalink
fix(form): validator 中的 value 类型更新为 any
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud committed Jul 3, 2024
1 parent eca8ad8 commit 82be780
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/packages/form/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import { Form, Button, InputNumber, Input, TextArea } from '@nutui/nutui-react'
import { FormItemRuleWithoutValidator } from '@/packages/formitem/types'

const Demo1 = () => {
return (
Expand All @@ -21,6 +22,14 @@ const Demo1 = () => {
rules={[
{ max: 5, message: '字段A不能超过5个字' },
{ required: true, message: '请输入字段A' },
{
validator: (
ruleCfg: FormItemRuleWithoutValidator,
value: string
) => {
return value.length > 5
},
},
]}
>
<Input
Expand Down

0 comments on commit 82be780

Please sign in to comment.