elementUI表格頭部添加icon並且鼠標移入顯示內容(render-header)


效果:

 

1、設置 render-header

<el-table-column prop="levelname" label="層次" width="180" show-overflow-tooltip :render-header="renderTableHeader" />

2、renderTableHeader 函數(放到methods中)

    renderTableHeader(h, { column }) {
      return h('div', [
        h('span', column.label),
        h('el-tooltip', { props: { placement: 'top' } }, [
          h(
            'div',
            {
              slot: 'content',
              style: { width: '220px', whiteSpace: 'normal' }
            },
            '選擇學校層級后會進行層級描述的回填,也可以在層級描述里進行二次編輯'
          ),
          h('i', {
            class: 'el-icon-information',
            style: 'color:#ccc;margin-left:5px;cursor:pointer;'
          })
        ])
      ])
    }

 


免責聲明!

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



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