1.创建表格

<el-table

ref="multipleTable"

:data="tableData"

border

>

<el-table-column fixed type="selection" align="center"></el-table-column>

<div v-for="(item,index) in columns" :key="index">

<el-table-column

:prop="item.prop"

:label="item.label"

:formatter="item.formatter"

align="center"

show-overflow-tooltip

></el-table-column>

</div>

</el-table>

2.创建表头+事件 

 

columns: [

{

prop: "index",

label: "序号",

formatter: (row, column, cellValue, index) => {

return <span οnclick={that.aa.bind(null, row)}>{index + 1}</span>;

}

},

{

prop: "userName",

label: "姓名"

},

{

prop: "roleName",

label: "角色名称"

},

{

prop: "topManagerUserVo",

label: "上级主管",

formatter: (row, column) => {

if (row.topManagerUserVo) {

return row.topManagerUserVo.roleName;

} else {

return "";

}

}

},

{

prop: "accountStatus",

label: "帐号状态",

formatter: (row, column) => {

if (row.accountStatus == 0) {

return "禁用";

}

if (row.accountStatus == 1) {

return "启用";

}

if (row.accountStatus == 2) {

return "已过期";

}

}

},

],

 

 

 

GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:3 个月前 )
c345bb45 7 个月前
a07f3a59 * Update transition.md * Update table.md * Update transition.md * Update table.md * Update transition.md * Update table.md * Update table.md * Update transition.md * Update popover.md 7 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐