我不知道我的代码有什么问题. 模板/组件/ item.hbs:
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default" {{action 'buttonClicked' item}} disabled={{unless item.isValid true}}>{{buttonLabel}}</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
组件/ item.js:
import Component from '@ember/component';
export default Component.extend({
buttonLabel: 'Save',
actions: {
buttonClicked(param) {
this.sendAction('action', param);
}
}
});
Run Code Online (Sandbox Code Playgroud)
Ember/library-app/app/components/item.js 8:13错误使用关闭操作,除非你需要冒泡的ember/closure-actions
ember.js ×1