ソースを参照

fix ProductSelector.vue

ali 2 年 前
親
コミット
09b75e0dd0

+ 11 - 1
src/components/FormBuilderCustumComponents/ProductSelector.vue

@@ -105,7 +105,17 @@ export default {
         ]
       },
       itemIdentifyKey: 'id',
-      itemIndicatorKey: (product) => product.title + '(' + product.id + ')'
+      itemIndicatorKey: (product) => product ? product.title + '(' + product.id + ')' : '-'
+    }
+  },
+  watch: {
+    value: {
+      handler (newValue) {
+        if (newValue) {
+          this.selected = newValue
+        }
+      },
+      immediate: true
     }
   },
   methods: {