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,