Selaa lähdekoodia

fix(cf): ProductEdit.vue addBundleItem 防止 null 报错

- 当 bundleItems 可能为 null 时默认值为空数组
- 防止 TypeError: Cannot read properties of null (reading 'bundleItems')
iwt 4 päivää sitten
vanhempi
sitoutus
08d52ac04c
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      cfc-web/src/views/admin/ProductEdit.vue

+ 1 - 0
cfc-web/src/views/admin/ProductEdit.vue

@@ -460,6 +460,7 @@ export default {
         }
       },
     addBundleItem() {
+      this.bundleItems = this.bundleItems || []
       this.bundleItems.push({
         childProductId: null,
         childSkuId: null,