我有一个名为"totalLength"的对象的ko.observable属性.在使用应用程序时,我想在物理上修改此属性的新值.我怎样才能做到这一点?
我可以通过显示以下内容来预览所需属性的值:
alert(feature.totalLength());
Run Code Online (Sandbox Code Playgroud)
所以我知道那是一个.但是当我为它分配一个新值时:
feature.totalLength() = 10;
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
ReferenceError:左侧无效赋值
为什么?