ElementUI-tooltip在表格中使用时内容不显示
#ElementUI-tooltip在表格中使用时内容不显示
错误代码
<el-table-column prop="teachingMon" label="星期一">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" placement="top-start">
<div slot="content">
<span>{{ dateFormat(scope.row.dateMon)}}</span>
</div>
{{ dateFormat(scope.row.dateMon) | slashMonth() }}
</el-tooltip>
</template>
</el-table-column>
更正:
<el-table-column prop="teachingMon" label="星期一">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" placement="top-start">
<div slot="content">
<span>{{ dateFormat(scope.row.dateMon)}}</span>
</div>
<span> {{ dateFormat(scope.row.dateMon) | slashMonth() }}</span>
</el-tooltip>
</template>
</el-table-column>
####总结: 表格内使用文字提示组件的时候{{}}中的内容需要用标签包裹,否则不显示