vue中使用element 的表格时,表格数据有html标签,正确显示标签
作为小白,总容易遇见各种坑。下面来说一下问题和解决办法下面这段代码是正常引用element的表格,<el-table:data="tableData"style="width: 100%"highlight-current-rowsize:medium><el-table...
·
作为小白,总容易遇见各种坑。下面来说一下问题和解决办法
下面这段代码是正常引用element的表格,
<el-table
:data="tableData"
style="width: 100%"
highlight-current-row
size:medium
>
<el-table-column
prop="date"
label="Domain"
width="180">
</el-table-column>
<el-table-column
prop="name"
label="System"
width="180">
</el-table-column>
<el-table-column
prop="address"
label="Creator">
</el-table-column>
<el-table-column
prop="name"
label="Remark"
width="180">
</el-table-column>
<el-table-column
prop="take"
label="Operating">
</el-table-column>
</el-table>
我想在最后一列td写html标签
data(){
return {
take:'<i class="iconfont icon-detail taskEntrance" value="132"></i><i class="iconfont icon-more active"></i>',
tableData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
take:'<i class="iconfont icon-detail taskEntrance" value="132"></i><i class="iconfont icon-more active"></i>'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄',
take:'<i class="iconfont icon-detail taskEntrance" value="132"></i><i class="iconfont icon-more active"></i>'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄',
take:'<i class="iconfont icon-detail taskEntrance" value="132"></i><i class="iconfont icon-more active"></i>'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄',
take:'<i class="iconfont icon-detail taskEntrance" value="132"></i><i class="iconfont icon-more active"></i>'
}]
}
},
解决办法:举一反三,看看table td里面button怎么加进去的
<el-table-column
prop="take"
label="Operating"
v-html="take">
<template slot-scope="scope">
<i class="el-icon-edit-outline"></i>
<i class="el-icon-tickets"></i>
<span>123</span>
<i class="iconfont icon-detail" style="height:20px;width:20px;font-size:10px;"></i>
</template>
</el-table-column>
template里面正常绑定什么的都可以了
更多推荐
已为社区贡献1条内容
所有评论(0)