Commit f698043e authored by 武广's avatar 武广

fix: 修改类型和类目之后清空属性

parent 5e272f2d
......@@ -92,6 +92,9 @@ const FormAttr = forwardRef((props, ref) => {
setInitAttrData(initValue.initValue);
setCategoryAttrs(res.data);
});
} else {
setInitAttrData({});
setCategoryAttrs([]);
}
};
......@@ -163,6 +166,9 @@ const FormAttr = forwardRef((props, ref) => {
const ids = props.categoryIds;
if (ids && ids.length) {
getAttribute(ids[ids.length - 1]);
} else {
setInitAttrData({});
setCategoryAttrs([]);
}
}, [props.categoryIds]);
......
......@@ -66,6 +66,7 @@ const ServiceGoods = options => {
const productChange = task => {
setProductType(task.type);
setCategoryIds([]);
const timer = setTimeout(() => {
resetForm();
clearTimeout(timer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment