el-table 鼠標移入顯示移出隱藏滾動條


話不多說,上代碼

<el-table
     :data="propertyData"
     style="width: 100%"
     max-height="400px"
     :class="[isDologin ? 'scrollbarShow' : 'commonScrollbarTable']"
     @cell-mouse-enter="enter"
     @cell-mouse-leave="leave">
          <el-table-column label="名稱" align="center" prop="assetsName" />
          <el-table-column label="品牌" align="center" prop="assetsBrand" />
          <el-table-column label="型號" align="center" prop="assetsModel" />
          <el-table-column label="數量" align="center" prop="number" />
</el-table> 
data(){
    return{
      propertyData:[],
      isDologin: false
    }
},
methods: {
     enter() {
      this.isDologin = true;
     },
     leave() {
      this.isDologin = false;
     }
}
/*滾動條的寬度*/
.commonScrollbarTable ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  display: none;
}
.scrollbarShow ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  display: block;
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM