• vue el-table 动态列 显示html标签内容


    <el-table @row-click="onRowClick" @selection-change="onSelectionChange" ref="testTable" :data="tableData" stripe :height="heightTable  + 'px'" style=" 100%">
    <template v-for="(item,index) in tableHead3">
    <el-table-column :prop="item.column_name" :label="item.column_comment" v-html="item.column_name" :show-overflow-tooltip="true" align="center" :key="index" >
    <template slot-scope="scope">
    <span v-html="scope.row[scope.column.property]"></span>
    <span v-html="scope.row[item.column_name]"></span>
    </template>
    </el-table-column>
    </template>
    </el-table>
    export default {
    name: 'Test',
    data() {
    return {
    tableHead3:[{code: '<span style='color:#ff0000'>test1</span>'}, {code: '<span style='color:#ff0000'>test1</span>'}],
           tableData: []
    }
    }
    }

      

  • 相关阅读:
    SpringMVC框架(2)
    SpringMVC框架(1)
    (数据结构与算法)跳表实现
    第2次作业
    第1次作业
    第一次作业
    第一周作业.
    第一周作业
    第0次作业
    第一次作业
  • 原文地址:https://www.cnblogs.com/zkx4213/p/14592891.html
Copyright © 2020-2023  润新知