<el-table :data="Gbtable" border style="width: 100%">
<el-table-column prop=" date" label="责任方" align="center" >
</el-table-column>
<el-table-column prop="name" label="柜名" align="center">
</el-table-column>
<el-table-column prop="address" align="center">
<template slot="header" slot-scope="slot">
<span class="gbRed">*产品名称</span><br />
<span class="gbMiniBlack">板件输条码/五金输名称</span>
</template>
<template slot-scope="scope">
<div>
</div>
</template>
</el-table-column>
<el-table-column prop="name" label="材质" align="center">
</el-table-column>
</el-table>
效果如下:
重点看这:文章来源:https://www.toymoban.com/news/detail-831599.html
<el-table-column prop="address" align="center">
//重点
<template slot="header" slot-scope="slot">
<span class="gbRed">*产品名称</span><br />
<span class="gbMiniBlack">板件输条码/五金输名称</span>
</template>
//
<template slot-scope="scope">
<div>
</div>
</template>
</el-table-column>
文章来源地址https://www.toymoban.com/news/detail-831599.html
到了这里,关于element-ui 自定义表头label(利用 :slot=“header“ slot-scope=“slot“)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!