嗨,我是 Handlebarsjs 的新手。
我有一组包含姓名、电子邮件、电话等的联系人,如下所示
[
{
"name": "Bob Wolmer",
"email": "bob@wolmer.com",
"phone": "(535) 235-1234",
"address": "301 Cobblestone Wy., Berdrock 00000",
"contactId": "1121",
"labels": {}
},
{
"name": "Wilma Erra",
"email": "wilma@erra.com",
"phone": "(535) 235-3659",
"address": "301 Cobblestone Wy., Berdrock 70777",
"contactId": "1122",
"labels": {}
},
{
"name": "Brad",
"email": "brad@brad.com",
"phone": "(535) 235-3546",
"address": "301 Cobblestone Wy., Redrock 70777",
"contactId": "1123",
"labels": [{"name": "Friends"},{"name": "Family"}]
},
{
"name": "",
"email": "wilson@gmail.com",
"phone": "(535) 235-3657",
"address": "301 Cobblestone Wy., Dedrock 70777",
"contactId": "1124",
"labels": [{"name": "Friends"}]
}
]
我想显示如下名称
B
Bob
Brad
W
Wilma Erra
任何人都可以建议我如何实现这一目标。
提前致谢