head-img Force's Blog

vue element-ui 表格列元素添加链接

JavaScript

如果要给表格列添加链接,则需要使用自定义列模板(针对element),通过 scoped slot 可以获取到 row, column, $index 和 store(table 内部的状态管理)的数据。关于自定义列模板,在https://element.eleme.cn/#/zh-CN/component/table
中有更详细的解释。

例子:

<el-table
    :data="forum_info"
    class="aca-table">
    <el-table-column prop="create_time"></el-table-column>
    <el-table-column prop="name"></el-table-column>
    <el-table-column prop="f_name"></el-table-column>
    <el-table-column>
        <a target="_blank" slot-scope="scope" :href="scope.row.frm_link">查看更多</a>
    </el-table-column>
    <el-table-column prop="location"></el-table-column>
    <el-table-column prop="status"></el-table-column>
</el-table>

参考链接:https://blog.csdn.net/huanxianxianshi/article/details/90484954

点我评论
打赏本文
二维码


125

文章

14

标签

 访客统计  Update-******