我無法啓用綁定在淘汰賽JS工作。將enabled屬性設置爲false時,該按鈕不會被禁用,我仍然可以單擊它。淘汰賽啓用約束力不工作
看到fiddle
<a class="btn btn-xl btn-primary"
href="#"
role="button"
data-bind="enable: enabled, click: clicked, visible: isVisible">
<i class="icon-only icon-ok bigger-130"></i>
</a>
var ViewModel = function(){
var self = this;
self.enabled = ko.observable(false);
self.isVisible = ko.observable(true);
self.clicked = function(){
alert('You clicked the button');
};
};
$(function(){
var model = new ViewModel();
ko.applyBindings(model);
})
感謝。我們得出了同樣的結論,但你更快到了那裏。 –
這是舊的,但小提琴需要關閉按鈕的數據綁定報價 –