【发布时间】:2018-07-04 14:12:13
【问题描述】:
问题是关于 VueJS 框架 - 元素:http://element.eleme.io
我有一些从数组中获取数据的表(el-table):
<el-table :data="someData">
<el-table-column prop="id" label="№"></el-table-column>
<el-table-column prop="is_active" label="Active"></el-table-column>
</el-table>
axios 从 DB 获取 JSON,数组如下:
[
{
"id":1,
"is_active":0
},
{
"id":2,
"is_active":1
},{
"id":3,
"is_active":1
}
]
任何人都知道如何说元素表只显示具有属性“is_active”eq 0 或 1(或其他条件)的行?
【问题讨论】:
-
为什么不在将数据传递给组件之前对其进行过滤,例如使用计算属性?