有没有办法在 Ember 中的多条路线之间共享公共事件?
样本:
App.CommonMenu = Ember.Mixin.create({
events: {
onDelete: function() {}
}
});
App.MainMenu = Ember.Route.extend(App.CommonMenu, {
events: {
onSave: function() {}
}
});
App.StoreMenu = Ember.Route.extend(App.CommonMenu, {
events: {
onSave: function(){}
}
})
我只是问,因为我继续收到一个错误,当单击一个按钮时,我会得到类似的东西:
Uncaught Error: Nothing handled the event 'onDelete'.