@ecoding/components.antd 0.5.15 → 0.5.16
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.
|
@@ -13,7 +13,7 @@ import { UploadOutlined } from "@ant-design/icons";
|
|
|
13
13
|
import { buildURL } from "@ecoding/helper.url";
|
|
14
14
|
import Toast from "../../core/toast";
|
|
15
15
|
const SingleFileUpload = (props) => {
|
|
16
|
-
const [fileUrl, setFileUrl] = useState(
|
|
16
|
+
const [fileUrl, setFileUrl] = useState(undefined);
|
|
17
17
|
const [loading, setLoading] = useState(false);
|
|
18
18
|
const action = useMemo(() => {
|
|
19
19
|
if (typeof props.action === "string") {
|
|
@@ -93,6 +93,9 @@ const SingleFileUpload = (props) => {
|
|
|
93
93
|
}, []);
|
|
94
94
|
useEffect(() => {
|
|
95
95
|
let item = props.value;
|
|
96
|
+
if (!item) {
|
|
97
|
+
setFileUrl(undefined);
|
|
98
|
+
}
|
|
96
99
|
if (typeof item === "string" && (item || item == '') && fileUrl != item) {
|
|
97
100
|
// 防止重复拼接domain
|
|
98
101
|
item = props.domain ? item.replace(props.domain, "") : item;
|
|
@@ -166,6 +166,9 @@ const ImgUpload = (props) => {
|
|
|
166
166
|
React.createElement("div", { style: { marginTop: 8 } }, props.buttonText))), [loading]);
|
|
167
167
|
useEffect(() => {
|
|
168
168
|
let item = props.value;
|
|
169
|
+
if (!item) {
|
|
170
|
+
setImageUrl(undefined);
|
|
171
|
+
}
|
|
169
172
|
if (typeof item === "string" && item) {
|
|
170
173
|
// 防止重复拼接domain
|
|
171
174
|
item = props.domain ? item.replace(props.domain, "") : item;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.16",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"antd": "^6.0.0",
|
|
48
48
|
"axios": "^1.1.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "078ccdbbe6892e97efd42efdd2afbe123be1daef"
|
|
51
51
|
}
|