002201 2 anos atrás
pai
commit
f71ddab60a

+ 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,