Commit a5234e60 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理新增商品直接点击价格属性报错问题

parent 1577cf8d
...@@ -95,7 +95,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -95,7 +95,8 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
// // *bug* 不点击本页面之前就变更了价格属性 这里的属性组合监听就失效了 // // *bug* 不点击本页面之前就变更了价格属性 这里的属性组合监听就失效了
useEffect(() => { useEffect(() => {
let len = combineAttributeArray.length let len = combineAttributeArray?.length
if(len){
// 第一次构建先和编辑数据比对 // 第一次构建先和编辑数据比对
if(updateFlag){ if(updateFlag){
if(len === productInfoByEdit?.unitPriceAndPicList.length){ if(len === productInfoByEdit?.unitPriceAndPicList.length){
...@@ -110,8 +111,9 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -110,8 +111,9 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
setCombineAttributeChangeFatories(len) setCombineAttributeChangeFatories(len)
clearPrice.current = true clearPrice.current = true
} }
}
// console.log(len, combineAttributeChangeFatories, `是否初次构建|${updateFlag.current}`, clearPrice.current, '监听前后属性条目的变动') // console.log(len, combineAttributeChangeFatories, `是否初次构建|${updateFlag.current}`, clearPrice.current, '监听前后属性条目的变动')
}, [combineAttributeArray.length]) }, [combineAttributeArray?.length])
_tableDataSource = useMemo(() => tableDataSource, [tableDataSource]) // 保持最新值 _tableDataSource = useMemo(() => tableDataSource, [tableDataSource]) // 保持最新值
......
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