fix(Sku): set properties when sku change (#13483)

Co-authored-by: jinzhiqiang <jinzhiqiang@youzan.com>
This commit is contained in:
Jacano
2025-05-20 21:25:48 +08:00
committed by GitHub
parent 4882cbef6a
commit 4e470d14c6
3 changed files with 4 additions and 2 deletions

View File

@@ -139,6 +139,7 @@ export default {
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
| start-sale-num | Minimum quantity | _number_ | `1` |
| properties | Goods properties | _array_ | - |
| skuProperties | Sku properties `v2.13.7` | _array_ | - |
| preview-on-click-image `v2.5.2` | Whether to preview image when click goods image | _boolean_ | `true` |
| show-header-image `v2.9.0` | Whether to display header image | _boolean_ | `true` |
| lazy-load | Whether to enable lazy loadshould register [Lazyload](#/en-US/lazyload) component | _boolean_ | `false` |

View File

@@ -144,6 +144,7 @@ export default {
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/advanced-usage#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` |
| start-sale-num | 起售数量 | _number_ | `1` |
| properties | 商品属性 | _array_ | - |
| skuProperties | 规格属性 `v2.13.7` | _array_ | - |
| preview-on-click-image `v2.5.2` | 是否在点击商品图片时自动预览 | _boolean_ | `true` |
| show-header-image `v2.9.0` | 是否展示头部图片 | _boolean_ | `true` |
| lazy-load `v2.9.0` | 是否开启图片懒加载,须配合 [Lazyload](#/zh-CN/lazyload) 组件使用 | _boolean_ | `false` |

View File

@@ -218,9 +218,9 @@ export default createComponent({
};
}
// 更新当前规格属性数据
this.setCurrentSkuProperties(skuComb ? skuComb.id : null);
if (skuComb) {
// 更新当前规格属性数据
this.setCurrentSkuProperties(skuComb.id);
skuComb.properties = getSelectedProperties(
this.propList,
this.selectedProp