@hw-component/form 1.6.3 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,16 +24,6 @@ const Test3 = ({ value, onChange }) => {
24
24
  );
25
25
  };
26
26
  const formData = (options) => {
27
- const op = [
28
- {
29
- key: 1,
30
- value: "是",
31
- },
32
- {
33
- key: 0,
34
- value: "否",
35
- },
36
- ];
37
27
  return [
38
28
  {
39
29
  label: "12321",
@@ -45,7 +35,7 @@ const formData = (options) => {
45
35
  },
46
36
  },
47
37
  {
48
- label: "测试12312",
38
+ label: "下拉",
49
39
  className: "hdjd",
50
40
  type: "select",
51
41
  name: "test321",
@@ -1,5 +1,5 @@
1
1
  import { HSelect } from "../../components";
2
- import {Space} from "antd";
2
+ import { Space } from "antd";
3
3
  import { useState } from "react";
4
4
  export default () => {
5
5
  const [selectVal, setSelectVal] = useState(null);
@@ -7,7 +7,7 @@ export default () => {
7
7
  <Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
8
8
  <HSelect
9
9
  options={[{ label: "测试", value: 1 }]}
10
- value={100}
10
+ value={1}
11
11
  placeholder="基础"
12
12
  allowClear={true}
13
13
  />
@@ -18,7 +18,7 @@ export default () => {
18
18
  { name: "测试2", value: 20, userId: 112321 },
19
19
  ]}
20
20
  placeholder="多选"
21
- value={selectVal}
21
+ value={[10, 20]}
22
22
  onChange={(val, option) => {
23
23
  setSelectVal(val);
24
24
  }}
@@ -37,28 +37,28 @@ export default () => {
37
37
  { label: "测试2", value: 20 },
38
38
  ]}
39
39
  />
40
- <HSelect
41
- placeholder="分页"
42
- serviceSearch
43
- allowClear={true}
44
- labelInValue
45
- mode="multiple"
46
- value={["21321312"]}
47
- request={(params)=>{
48
- const {page,size}=params
49
- const op=[];
50
- for (let i=0;i<size;i+=1){
51
- op.push( { label: `第${page}页第${i}条`, value:i+page })
52
- }
53
- return {
54
- page,
55
- size:100,
56
- total:1000,
57
- data:op
58
- }
59
- }}
60
- isList
61
- />
40
+ <HSelect
41
+ placeholder="分页"
42
+ serviceSearch
43
+ allowClear={true}
44
+ labelInValue
45
+ mode="multiple"
46
+ value={["21321312"]}
47
+ request={(params) => {
48
+ const { page, size } = params;
49
+ const op = [];
50
+ for (let i = 0; i < size; i += 1) {
51
+ op.push({ label: `第${page}页第${i}条`, value: i + page });
52
+ }
53
+ return {
54
+ page,
55
+ size: 100,
56
+ total: 1000,
57
+ data: op,
58
+ };
59
+ }}
60
+ isList
61
+ />
62
62
  <HSelect
63
63
  serviceSearch={true}
64
64
  request={(params) => {