大略代码是这样的:
调用element ui table的renderHeader接口
methods: { renderHeader(h, data) { let column = data.column; let label = column.label; switch(label) { case '登录人数': tip = '登录本零碎的人数,包含挪动端,网页端' case '登录次数': tip = '登录本零碎的次数,包含挪动端,网页端' defalult: tip = ''; } return ('<el-tooltip content={tip} placement='top-start'> <span>表头题目</span> </el-tooltip>') }}