我有一个Backbone项目,其中包含一些React代码,我需要在它们之间共享一个Backbone模型对象。
我正在使用redux共享数据,并且名为orderFunctionality
的主干模型对象传递得很好,但是当我尝试从React更改模型对象中的数据时,我得到了“对象不是可扩展错误”:>
已初始化了orderFunctionality模型的主干视图,并将orderFunctionality传递给React应用程序:
return Widget.extend({
initialize: function () {
},
render: function () {
Widget.prototype.render.call(this);
ReactApp.registerOrderFunctionality(orderFunctionality);
ReactApp.bootstrap(this.$el.find('.main_cont')[0], 'Market');
},
尝试设置成员时出现错误:
addOrdersWithPopup: function (offerPrice, bidPrice, offerAmount) {
if(offerPrice && offerAmount){
this._currentBidAmount = 0;
}
错误消息:
未捕获的TypeError:无法添加属性_currentBidAmount,对象不可扩展