iview table expand 單擊當前行控制


 1、添加元素與js

 <Table :columns="thList" :data="list" @on-row-click="toggleTableExpand" ref="tableExpand"></Table>
 
 // 源碼里有toggleExpand方法,可以直接使用
 methods:{
    toggleTableExpand(row, index) {
      this.$refs.tableExpand.toggleExpand(index);
    },
 }

2、如果默認元素(箭頭)點擊無效,可添加樣式覆蓋
td.expandBox .ivu-table-cell{   position: relative;   &::after{     position: absolute;     content: '';     top: 0;     left:0;     height: 100%;     width:100%;     z-index: 9;
  }   &:hover{     .ivu-icon-ios-arrow-forward{       color:#1d7cd0;       border-color:#1d7cd0;
     }   } }

 

 


免責聲明!

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



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