1
我有以下代码:当我们在Ember中传递动作时,yield如何表现?
组件模板
{{#link-to "user.profile" account.id disabled=user.online}}
{{yield}}
{{/link-to}}
模板
{{#my-component data=x}}
<button> MY BUTTON </button>
{{/my-component}}
我使用的组件在不同的模板,我想将产生的元素有一种行为。我读过你可以像这样使用它,但我无法真正掌握这一行为。
{{#link-to "user.profile" account.id disabled=user.online}}
{{yield (action "showModal")}}
{{/link-to}}
任何人都可以揭示出这个问题的一些轻?