002201 2 년 전
부모
커밋
f71ddab60a
2개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 3
      src/components/popover-select/index.vue
  2. 4 3
      src/components/popover-tree-select/index.vue

+ 4 - 3
src/components/popover-select/index.vue

@@ -80,11 +80,12 @@ export default {
   watch: {
     "$props.value": {
       handler: function (newProp, oldProp) {
-        if (!newProp) {
+        if (newProp) {
+          const { multiple } = this.$props;
+          this.showValue = multiple ? "" : newProp;
+        } else {
           this.data = [];
           this.showValue = "";
-        } else {
-          this.showValue = newProp;
         }
       },
       immediate: true,

+ 4 - 3
src/components/popover-tree-select/index.vue

@@ -79,11 +79,12 @@ export default {
   watch: {
     "$props.value": {
       handler: function (newProp, oldProp) {
-        if (!newProp) {
+        if (newProp) {
+          const { multiple } = this.$props;
+          this.showValue = multiple ? "" : newProp;
+        } else {
           this.data = [];
           this.showValue = "";
-        } else {
-          this.showValue = newProp;
         }
       },
       immediate: true,