【发布时间】:2016-02-28 00:27:39
【问题描述】:
如果我有块形式的组件:
//some-component.hbs
{{#some-component}}
<button {{action "someAction"}}>test</button>
<!-- assume you have multiple buttons here with multiple actions -->
{{/some-component}}
//some-component.js
Ember.Component.extend({
actions: {
someAction() {
alert('NOT BEING CALLED');
}
}
});
使用 Ember > v2.0。未调用该操作。 如果我称之为:
{{some-component}}
然后放:
<button {{action "someAction"}}>test</button>
在 some-component.hbs 模板中。然后它工作。但这种方式有一些我想避免的缺点。
我查看了文档,但似乎到处都没有这种情况。
【问题讨论】:
标签: ember.js