如何将工具提示添加到 table headers in element-ui (vue.js)?
How to add tooltip to table headers in element-ui (vue.js)?
我认为这行得通,但行不通:
<template lang="pug">
el-table(:data="myDataSet")
el-table-column
template(slot="label")
el-tooltip(content="Verification of Reference")
| VOR Status
template(slot-scope="props")
| {{ props.row.myData }}
</template>
请帮忙,谢谢。
<el-table-column prop="value"
label="Value"
:render-header="renderPhaseHeader">
</el-table-column>
methods: {
renderPhaseHeader(h, { column }) {
return h('span', {
class: 'class-name-if-you-want'
}, [
column.label + " ",
h('el-tooltip', {
class: 'class-name-if-you-want',
attrs: {
'content': 'message',
'effect': 'light',
'placement': 'top-start'
}
}, [
h('i', {
class: 'far fa-question-circle'
})
])
])
}
}
你可以使用插槽="header"
<el-table-column>
<template
slot="header">
<el-popover
ref="fromPopOver"
placement="top-start"
width="250"
trigger="hover">
<span>
Tooltip info here
</span>
</el-popover>
<span>Destination <i
v-popover:fromPopOver
class="el-icon-info
text-blue" />
</span>
</template>
<template slot-scope="scope">
<span>{{ scope.row.SomeData }}</span>
</template>
我认为这行得通,但行不通:
<template lang="pug">
el-table(:data="myDataSet")
el-table-column
template(slot="label")
el-tooltip(content="Verification of Reference")
| VOR Status
template(slot-scope="props")
| {{ props.row.myData }}
</template>
请帮忙,谢谢。
<el-table-column prop="value"
label="Value"
:render-header="renderPhaseHeader">
</el-table-column>
methods: {
renderPhaseHeader(h, { column }) {
return h('span', {
class: 'class-name-if-you-want'
}, [
column.label + " ",
h('el-tooltip', {
class: 'class-name-if-you-want',
attrs: {
'content': 'message',
'effect': 'light',
'placement': 'top-start'
}
}, [
h('i', {
class: 'far fa-question-circle'
})
])
])
}
}
你可以使用插槽="header"
<el-table-column>
<template
slot="header">
<el-popover
ref="fromPopOver"
placement="top-start"
width="250"
trigger="hover">
<span>
Tooltip info here
</span>
</el-popover>
<span>Destination <i
v-popover:fromPopOver
class="el-icon-info
text-blue" />
</span>
</template>
<template slot-scope="scope">
<span>{{ scope.row.SomeData }}</span>
</template>