且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过控制器动作在ember 2.x中以程序方式添加组件

更新时间:2023-02-16 10:59:11

您需要导入组件,那么您不需要Ember Global。

You need to import the component, then you don't need the Ember Global.

import AuthorNameComponent from '../components/author-name-component'

另一种方法是一个项目的数组,并从那里创建一个作者NameComponent的列表。

Another way is to have an array of items and base the list of AuthorNameComponent from that.

{{#each items as |item|}}
    {{author-name name=item.name}}
{{/each}}