@hw-component/form 1.4.5 → 1.4.6
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.
- package/es/Form/hooks/useHForm.js +0 -1
- package/es/Select/hooks/changeHooks.js +5 -1
- package/lib/Form/hooks/useHForm.js +0 -1
- package/lib/Select/hooks/changeHooks.js +5 -1
- package/package.json +1 -1
- package/src/components/Form/hooks/useHForm.ts +0 -1
- package/src/components/Select/hooks/changeHooks.tsx +5 -1
- package/src/pages/Select/index.tsx +1 -2
|
@@ -180,10 +180,14 @@ var useValueChange = function useValueChange(params) {
|
|
|
180
180
|
onChange(newChangeVal, subItemOps);
|
|
181
181
|
};
|
|
182
182
|
useEffect(function () {
|
|
183
|
-
if (mode === "tags"
|
|
183
|
+
if (mode === "tags") {
|
|
184
184
|
setVal(value);
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
|
+
if (value === null || value === undefined) {
|
|
188
|
+
setVal(undefined);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
187
191
|
if (options) {
|
|
188
192
|
setVal(function (oldVale) {
|
|
189
193
|
return matchNotFind(params, oldVale);
|
|
@@ -181,10 +181,14 @@ var useValueChange = function useValueChange(params) {
|
|
|
181
181
|
onChange(newChangeVal, subItemOps);
|
|
182
182
|
};
|
|
183
183
|
React.useEffect(function () {
|
|
184
|
-
if (mode === "tags"
|
|
184
|
+
if (mode === "tags") {
|
|
185
185
|
setVal(value);
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
+
if (value === null || value === undefined) {
|
|
189
|
+
setVal(undefined);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
188
192
|
if (options) {
|
|
189
193
|
setVal(function (oldVale) {
|
|
190
194
|
return matchNotFind(params, oldVale);
|
package/package.json
CHANGED
|
@@ -142,10 +142,14 @@ export const useValueChange = (params: PartialHSelectProps) => {
|
|
|
142
142
|
onChange(newChangeVal, subItemOps);
|
|
143
143
|
};
|
|
144
144
|
useEffect(() => {
|
|
145
|
-
if (mode === "tags"
|
|
145
|
+
if (mode === "tags" ) {
|
|
146
146
|
setVal(value);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
+
if (value===null||value===undefined){
|
|
150
|
+
setVal(undefined);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
149
153
|
if (options) {
|
|
150
154
|
setVal((oldVale) => {
|
|
151
155
|
return matchNotFind(params, oldVale);
|
|
@@ -2,7 +2,7 @@ import { HSelect } from "../../components";
|
|
|
2
2
|
import { Space } from "antd";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
export default () => {
|
|
5
|
-
const [selectVal, setSelectVal] = useState(
|
|
5
|
+
const [selectVal, setSelectVal] = useState(null);
|
|
6
6
|
return (
|
|
7
7
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
8
8
|
<HSelect
|
|
@@ -20,7 +20,6 @@ export default () => {
|
|
|
20
20
|
placeholder="多选"
|
|
21
21
|
value={selectVal}
|
|
22
22
|
onChange={(val, option) => {
|
|
23
|
-
console.log(option,"optionoptionoption")
|
|
24
23
|
setSelectVal(val);
|
|
25
24
|
}}
|
|
26
25
|
allSelect={true}
|