소스 검색

fix ProductSelector.vue

ali 2 년 전
부모
커밋
09b75e0dd0
1개의 변경된 파일과 11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      src/components/FormBuilderCustumComponents/ProductSelector.vue

+ 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: {