table表头换行


 

 

 方法一:

<el-table
      height="570" size="mini"
      :data="projectData"
      style="width: 100%"
    >
      <el-table-column
        show-overflow-tooltip
        prop="project_dept_user_name"
        label="项目负责人"
        min-width="120"
      ></el-table-column>
      <el-table-column
        show-overflow-tooltip
        prop="status_name"
        label="项目状态"
        min-width="120"
      ></el-table-column>
      <el-table-column show-overflow-tooltip label="图纸文件是否|全部交付" :render-header="renderheader" min-width="100">
        <template slot-scope="scope" v-if=" scope.row.all_deliver==0"></template>
        <template slot-scope="scope" v-else></template>
      </el-table-column>
      <el-table-column
        show-overflow-tooltip :render-header="renderheader"
        label="单位工时产值|(元/小时)"
        min-width="120"
      >
        <template slot-scope="scope">{{scope.row.hours_amount/100}}</template>
      </el-table-column>
    </el-table>
 // 表头换行
      renderheader(h, {column, $index}) {
        return h('span', {}, [
          h('span', {}, column.label.split('|')[0]),
          h('br'),
          h('span', {}, column.label.split('|')[1])
        ])
      },

  方法二

<el-table height="580px" :data="tableData" size="mini" style="width: 100%">
        <el-table-column prop="project_num" label="角色" min-width="60"></el-table-column>
        <el-table-column prop="project_num" :label="'合同额 \n (元)'" min-width="60"></el-table-column>
        <el-table-column prop="project_num" :label="'回款额 \n (元)'" min-width="60"></el-table-column>
        <el-table-column prop="project_num" label="回款比例" min-width="60"></el-table-column>
        <el-table-column prop="project_num" :label="'计业绩金额 \n (元)'" min-width="60"></el-table-column>
        <el-table-column prop="project_num" :label="'个人业绩 \n (元)'" min-width="60"></el-table-column>
      </el-table>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM