elementUI的el-table自定义表头

<el-table-column

label="昨日仪表里程(KM)"

align="left"

min-width="190"

:render-header="(h, obj) => renderHeader(h, obj, '参数')"

>

<template slot-scope="scope">

<span>{{ scope.row.firstStartMileage || 0 }}</span>

</template>

</el-table-column>
// 自定义表头

renderHeader (h, { column, $index }, type) {

// console.log('列表加载就会触发', h, { column, $index }, type)

// 逻辑是 h() 括号里包裹标签:第一个参数是标签名,第二个是属性,第三个是标签内容。 如果是多个标签需要包裹数组

return h('div', [

h('span', column.label),

h('el-tooltip', {

props: {

effect: 'dark',

content: '结束仪表里程',

placement: 'top',

},

},

h('i', { class: 'el-icon-question', style: 'color:#999;margin-left:5px;', }), \], ), \]); },

相关推荐
写bug的可宋1 分钟前
【Electron】解决Electron使用阿里iconfont不生效问题(react+vite)
javascript·react.js·electron
摘星编程12 小时前
React Native for OpenHarmony 实战:Linking 链接处理详解
javascript·react native·react.js
胖者是谁12 小时前
EasyPlayerPro的使用方法
前端·javascript·css
EndingCoder12 小时前
索引类型和 keyof 操作符
linux·运维·前端·javascript·ubuntu·typescript
摘星编程13 小时前
React Native for OpenHarmony 实战:ImageBackground 背景图片详解
javascript·react native·react.js
摘星编程14 小时前
React Native for OpenHarmony 实战:Alert 警告提示详解
javascript·react native·react.js
Joe55614 小时前
vue2 + antDesign 下拉框限制只能选择2个
服务器·前端·javascript
WHS-_-202214 小时前
Tx and Rx IQ Imbalance Compensation for JCAS in 5G NR
javascript·算法·5g
摘星编程14 小时前
React Native for OpenHarmony 实战:GestureResponderSystem 手势系统详解
javascript·react native·react.js
lili-felicity14 小时前
React Native for OpenHarmony 实战:加载效果的实现详解
javascript·react native·react.js·harmonyos