Vue中使用element table,表格参数格式化 formatter
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
template
<el-table :data="tableDataList" border style="width: 100%">
<el-table-column
prop="smsTaskID"
label="任务ID"
align="center">
</el-table-column>
<el-table-column
prop="recallProjectType"
label="召回方案"
align="center"
:formatter="formatType"
>
</el-table-column>
<el-table-column
prop="taskStartDate"
label="推送时间"
align="center">
<template slot-scope="scope"> {{ scope.row.taskStartDate | formatDate('yyyy-MM-dd hh:mm') }} </template>
</el-table-column>
</el-table>
data
tableData: [{
smsTaskID: 6,
recallProjectType: 1,
taskStartDate :1566439557000
}, {
smsTaskID: 7,
recallProjectType: 2,
taskStartDate : 1566380697000
}]
methods
formatType (row) {
return row.recallProjectType === 1 ? '高覆盖' : row.recallProjectType === 2 ? '高性价比' : '所有人'
}
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 个月前
更多推荐
已为社区贡献2条内容
所有评论(0)