Questions tagged «knockout-templating»

1
使用数据绑定到图像src属性的删除模板不起作用
我看不到这里出了什么问题,但是使用以下的Knockout模板无法显示图片: <script type="text/html" id="legend-template"> <div><input type="checkbox" data-bind="click : doSomething" ></input> <img width="16px" height="16px" data-bind="src: 'imagePath'" /> <span data-bind="text : label"> </span> </div> </script> 绑定到的对象如下所示: tut.myObject= function (imagePath, label) { this.label = ko.observable(label); this.imagePath = ko.observable(imagePath || liveString + '/Content/images/marker.png'); }; tut.myObject.prototype = { doSomething: function () { alert("do what?"); } …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.