假设我有不同的视图,每个视图都有特定于events: { "dblclick div.editable": "edit" }
我想edit
在不同视图之间共享功能(然后也保存)的项目的 DOM 事件。
var View1 = Backbone.View.extend({
events: { "dblclick div.editable": "edit" },
edit: function () {} // function I would like to share btw diff views
});
var View2 = Backbone.View.extend({
events: { "dblclick div.editable": "edit" },
edit: function () {} // function I would like to share btw diff views
});
有可能吗?
最好的方法是什么?
有一些例子吗?