Ember.js 余烬数组迭代

Ember.js 余烬数组迭代,ember.js,ember-data,Ember.js,Ember Data,我在模型中获取JSON,并在模板上进行良好渲染,但是,我希望在模板上访问此数组(项)。这里的目标是在导航栏中动态呈现这些菜单项 我的把手看起来像这样 {{#each menus as |menu|}} {{#each menu.items as |items|}} {{items}} {{/each}} {{/each}} 返回 [object Object] [object Object] [object Object] 有什么想法吗 下面是JSON {

我在模型中获取JSON,并在模板上进行良好渲染,但是,我希望在模板上访问此数组(项)。这里的目标是在导航栏中动态呈现这些菜单项

我的把手看起来像这样

{{#each menus as |menu|}}
    {{#each menu.items as |items|}}
        {{items}}
    {{/each}}
{{/each}}
返回

[object Object] [object Object] [object Object]
有什么想法吗

下面是JSON

{
 "ID": 2,
 "name": "Main Menu",
 "slug": "main-menu",
 "description": "",
 "count": 4,
 "items": [
     {
         "id": 11,
         "order": 1,
         "parent": 0,
         "title": "Contact",
         "url": "http://localhost:8888/contact/",
         "attr": "",
         "target": "",
         "classes": "",
         "xfn": "",
         "description": "",
         "object_id": 7,
         "object": "page",
         "object_slug": "contact",
         "type": "post_type",
         "type_label": "Page"
     },
     {
         "id": 12,
         "order": 2,
         "parent": 0,
         "title": "About",
         "url": "http://localhost:8888/about/",
         "attr": "",
         "target": "",
         "classes": "",
         "xfn": "",
         "description": "",
         "object_id": 5,
         "object": "page",
         "object_slug": "about",
         "type": "post_type",
         "type_label": "Page",
         "children": [
             {
                 "id": 21,
                 "order": 3,
                 "parent": 12,
                 "title": "About Us – Sub",
                 "url": "http://localhost:8888/about/about-us-sub/",
                 "attr": "",
                 "target": "",
                 "classes": "",
                 "xfn": "",
                 "description": "",
                 "object_id": 9,
                 "object": "page",
                 "object_slug": "about-us-sub",
                 "type": "post_type",
                 "type_label": "Page"
             }
         ]
     },
     {
         "id": 13,
         "order": 4,
         "parent": 0,
         "title": "Home",
         "url": "http://localhost:8888/home/",
         "attr": "",
         "target": "",
         "classes": "",
         "xfn": "",
         "description": "",
         "object_id": 2,
         "object": "page",
         "object_slug": "home",
         "type": "post_type",
         "type_label": "Page"
      }
  ],
 "meta": {
     "links": {
         "collection": "http://localhost:8888/wp-json/wp/v2/menus/",
         "self": "http://localhost:8888/wp-json/wp/v2/menus/2"
     }
 }
}

这是因为这就是对象在字符串化时的外观。您是否尝试过显示对象的特定属性?是的,我也一样,页面没有任何内容(对格式错误表示歉意)。{{{{{35;每个菜单作为{124;菜单}}{{{{{35;每个菜单.项目作为{124;项目}}{{{items.name}{{{{/each}}}{{/each}}@AndrewLi仔细想想,我再试了一次,效果不错,谢谢!有时候我只是需要一点大脑的启动!