Custom Binding not working updating from Knockout 2.3 to 3.3

帅比萌擦擦* 提交于 2019-12-06 12:09:52

The error is caused because Knockout 3.x binds to functions differently. In 2.x, you could bind directly to a function, but in 3.x, Knockout calls the function to get the viewmodel. You can still bind to a function in Knockout 3.x, but you'll need to wrap it in an observable or in another function.

ko.applyBindings(function() { return commandWrapper }, element);

https://jsfiddle.net/mbest/nrb97g7e/38/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!