element ui 中可以通过设置slot-scope 定值列,但是增加超级链接需要采用v-bind来修饰一下:
<el-table :data="tableData">
<el-table-column v-for="(item, index) in tableHeader"
:label="item"
:column-key="item"
:prop="item"
:key="index"
>
<template slot-scope="scope"> {{ scope.row[item] }}</template>
</el-table-column>
<af-table-column>
<template slot-scope="scope">
<el-link v-bind:href="'engineeringElementOperation/exportToFile/?id='+scope.row['id']">
{{ oname }}
</el-link>
</template>
</af-table-column>
</el-table>
请注意<el-link>标签的写法。
本文介绍如何在ElementUI的表格组件中使用slot-scope定义固定列,并通过v-bind添加超级链接。利用<el-link>标签实现外部链接跳转。
657

被折叠的 条评论
为什么被折叠?



