我正在使用以这种格式检索的JSON数据。这是我将获得的数据样本。基本上,我已经做到了没有使用铁列表,只是重复内部重复3级深。但我遇到了性能问题,我想知道iron-list是否会有所帮助。
第一级锚定组将是铁折叠(用户可折叠),在每个组中将有一个纸卡,每个锚点有一个标题。在报头下面是另一个铁崩溃,它将列出路由。
看看铁名单上的例子,它看起来是一维的。
anchor group
-> anchor
->route
->route
anchor group
-> anchor
->route
->route这是显示应该是什么样子的示例。
[
{
"anchors":[
{"anchorid":1,
"routes":[
{"name":"route 1", "routeid":1 },
{"name":"route 2", "routeid":2 },
{"name":"route 3", "routeid":3 }
]
},
{"anchorid":2,
"routes":[
{"name":"route 4", "routeid":4 },
{"name":"route 5", "routeid":5 },
{"name":"route 6", "routeid":6 }
]
}
]
},
{
"anchors":[
{"anchorid":3,
"routes":[
{"name":"route 7", "routeid":7 },
{"name":"route 8", "routeid":8 },
{"name":"route 9", "routeid":9 }
]
},
{"anchorid":4,
"routes":[
{"name":"route 10", "routeid":10 },
{"name":"route 11", "routeid":11 },
{"name":"route 12", "routeid":12 }
]
}
]
}
]发布于 2015-09-05 08:22:16
您可以将包含数组的数据对象与聚合物的iron-list绑定。但它还不支持群组,请查看feature backlog查看当前状态。
我不确定您到底想在iron-list中显示什么,所以我在下面提供了一个典型的json结构(这是一种精简的PouchDB格式)。
json列表数据示例:
{
"offset": 0,
"total_rows": 2,
"rows": [
{
"doc": {
"_id": "1",
"name": "one"
}
},
{
"doc": {
"_id": "2",
"name": "two"
}
}
]
}html代码片段:
<iron-list id="my-list" items="{{listData.rows}}" as="item" class="fit">
<template>
<p>{{item.doc.name}}</p>
</template>
</iron-list>https://stackoverflow.com/questions/32218325
复制相似问题