element ui table隱藏幾列展開某幾列 進行切換

	<el-button type="primary" @click="allExpand">展開</el-button>
	<el-table
      ref="voucherTable"
      :key="tableKey"
      v-loading="listLoading"
      :data="list"
      border
      fit
      highlight-current-row
      row-key="pzmxid"
      default-expand-all
      :tree-props="treeProps"
      :header-cell-style="{textAlign:'center', height: '20px'}"
      @current-change="handleCurrentChange"
      @row-dblclick="handleSkim(currentRow)"
    >
data() {
  return {
  	tableKey: 0,
  	treeProps: { children: 'children', hasChildren: 'hasChildren' }
  }
}
// 全部展開
allExpand() {
  this.tableKey = this.tableKey + 1
  this.showReviewer = !this.showReviewer
  if (this.treeProps.children && this.treeProps.hasChildren) {
    this.treeProps = { children: '', hasChildren: '' }
  } else {
    this.treeProps = { children: 'children', hasChildren: 'hasChildren' }
  }
  this.listLoading = false
},
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章