Skip to content

Commit 4e470d1

Browse files
Jcannojinzhiqiang
andauthored
fix(Sku): set properties when sku change (#13483)
Co-authored-by: jinzhiqiang <jinzhiqiang@youzan.com>
1 parent 4882cbe commit 4e470d1

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/sku/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export default {
139139
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
140140
| start-sale-num | Minimum quantity | _number_ | `1` |
141141
| properties | Goods properties | _array_ | - |
142+
| skuProperties | Sku properties `v2.13.7` | _array_ | - |
142143
| preview-on-click-image `v2.5.2` | Whether to preview image when click goods image | _boolean_ | `true` |
143144
| show-header-image `v2.9.0` | Whether to display header image | _boolean_ | `true` |
144145
| lazy-load | Whether to enable lazy load,should register [Lazyload](#/en-US/lazyload) component | _boolean_ | `false` |

src/sku/README.zh-CN.md

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

src/sku/Sku.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ export default createComponent({
218218
};
219219
}
220220

221+
// 更新当前规格属性数据
222+
this.setCurrentSkuProperties(skuComb ? skuComb.id : null);
221223
if (skuComb) {
222-
// 更新当前规格属性数据
223-
this.setCurrentSkuProperties(skuComb.id);
224224
skuComb.properties = getSelectedProperties(
225225
this.propList,
226226
this.selectedProp

0 commit comments

Comments
 (0)