Ver Fonte

修改浏览器返回还显示下拉菜单问题

achao há 3 anos atrás
pai
commit
ec26b8b58d
1 ficheiros alterados com 12 adições e 2 exclusões
  1. 12 2
      src/views/houseSelfCollect/acquisitionManagementAdd.vue

+ 12 - 2
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -14,7 +14,7 @@
         <div class="row1">
           <div class="grid-content">
             <el-form-item label="货名">
-              <el-select v-model="selectVal" placeholder="请选择" @change="goodsChange" :disabled="!isEdit" filterable clearable>
+              <el-select v-model="selectVal" placeholder="请选择" @change="goodsChange" :disabled="!isEdit" filterable clearable ref="elSelect">
                 <el-option v-for="item in goodnameList" :key="item.constValue" :label="item.constValue"
                   :value="item.constValue">
                 </el-option>
@@ -256,6 +256,7 @@
         checkList4: []
       }
     },
+
     activated() {
       // 货名
       let _goodsNameList = []
@@ -380,8 +381,17 @@
           break
       }
     },
-    mounted() {},
+     mounted() {
+         if (window.history && window.history.pushState) {
+             history.pushState(null, null, document.URL);
+             window.addEventListener("popstate", this.onCloseGoodSelect, false);
+         }
+     },
     methods: {
+      //修改点击浏览器返回还显示下拉菜单为题
+      onCloseGoodSelect(){
+        this.$refs.elSelect.blur()
+      },
       paramTypeChange(e){
         // this.makeTableList()
       },