wangnan 7 年 前
コミット
a7a330c729
2 ファイル変更18 行追加0 行削除
  1. 11 0
      src/package/choose/src/choose.vue
  2. 7 0
      src/view/choose.vue

+ 11 - 0
src/package/choose/src/choose.vue

@@ -78,6 +78,10 @@ export default {
         short:{
         short:{
             type:Boolean,
             type:Boolean,
             default:false,
             default:false,
+        },
+        loading:{
+            type:Boolean,
+            default:false,
         }
         }
     },
     },
     mounted() {
     mounted() {
@@ -96,6 +100,7 @@ export default {
             tempDatas:[],
             tempDatas:[],
             tabIndex:0,
             tabIndex:0,
             currItem:{},
             currItem:{},
+            isLoading:false,
         };
         };
     },
     },
     watch:{
     watch:{
@@ -129,6 +134,9 @@ export default {
                 this.tabIndex += 1;
                 this.tabIndex += 1;
 
 
             }
             }
+        },
+        loading(val,oldVal){
+            this.isLoading = val;
         }
         }
     },
     },
     methods: {
     methods: {
@@ -149,6 +157,9 @@ export default {
             this.currItem = {};
             this.currItem = {};
         },
         },
         getNextList(item){
         getNextList(item){
+            if(this.isLoading){
+                return;
+            }
             this.tempDatas[this.tabIndex-1].item = item;
             this.tempDatas[this.tabIndex-1].item = item;
             this.currItem = item;
             this.currItem = item;
             this.$emit('choose-item',item,this.tabIndex);
             this.$emit('choose-item',item,this.tabIndex);

+ 7 - 0
src/view/choose.vue

@@ -41,6 +41,13 @@
               <td>true</td>
               <td>true</td>
             </tr>
             </tr>
             <tr>
             <tr>
+              <td>loading</td>
+              <td>是否还在异步加载数据中</td>
+              <td>Boolean</td>
+              <td>false</td>
+              <td>true</td>
+            </tr>
+            <tr>
               <td>needCache</td>
               <td>needCache</td>
               <td>弹层打开后再关闭是否需要缓存下来数据,以备下次打开使用</td>
               <td>弹层打开后再关闭是否需要缓存下来数据,以备下次打开使用</td>
               <td>Boolean</td>
               <td>Boolean</td>