diff --git a/test/src/Antd.tsx b/test/src/Antd.tsx index 538a212..e05bc37 100644 --- a/test/src/Antd.tsx +++ b/test/src/Antd.tsx @@ -1,4 +1,15 @@ -import { Button, Checkbox, Input, InputNumber, Radio, Select, Switch, TreeSelect } from 'antd' +import { + Button, + Checkbox, + DatePicker, + Input, + InputNumber, + Radio, + Select, + Switch, + TimePicker, + TreeSelect +} from 'antd' import { Verifications, useAttr, useFormData } from 'hook-form-react' import { Antd_5 } from 'hook-form-react/Antd_5' import { animals, treeData } from './data' @@ -11,7 +22,7 @@ export default function Antd() { value11: 1, value6: true, value2: false, - value7: [], + value7: [] as string[], value3: [], value4: {}, value5: '', @@ -20,7 +31,8 @@ export default function Antd() { { value: [Verifications.required()], value5: [Verifications.required()], - value8: [Verifications.required()], + value7: [Verifications.minLenth(2, '请选择时间范围')], + value8: [Verifications.required('请选择时间')], value10: [Verifications.min(10)] } ) @@ -56,7 +68,21 @@ export default function Antd() { {it.label} ))} - + + + + + + + + + + + + diff --git a/test/src/App.tsx b/test/src/App.tsx index 391180d..5a0be57 100644 --- a/test/src/App.tsx +++ b/test/src/App.tsx @@ -5,28 +5,30 @@ import Antd from './Antd' export default function App() { return ( - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + +
) } diff --git a/test/src/NextUI.tsx b/test/src/NextUI.tsx index e7d4959..fbf5df0 100644 --- a/test/src/NextUI.tsx +++ b/test/src/NextUI.tsx @@ -295,21 +295,31 @@ export const NextUI = () => { -
-

Form Value:

-
-          {JSON.stringify(formData.value, null, 1)}
-        
-

SubForm, Value10:

-
{JSON.stringify(value10, null, 1)}
-

Error:

-
-          {JSON.stringify(formData.errors, null, 1)}
-        
-

Value10 Error:

-
-          {JSON.stringify(value10Form.errors, null, 1)}
-        
+
+
+

Form Value:

+
+            {JSON.stringify(formData.value, null, 1)}
+          
+
+
+

SubForm, Value10:

+
+            {JSON.stringify(value10, null, 1)}
+          
+
+
+

Error:

+
+            {JSON.stringify(formData.errors, null, 1)}
+          
+
+
+

Value10 Error:

+
+            {JSON.stringify(value10Form.errors, null, 1)}
+          
+
)