假设我有,
<ul data-bind="foreach: items">
<li>
<span data-bind="text: name"></span>
<span data-bind="visible: $parent.checkVisiblity"></span>
</li>
</ul>
和
var ViewModel = function() {
this.items = [{name: 'a'},{name: 'b'}];
this.checkVisiblity = function(item) {
console.log(item)
return item.name === 'a';
}
};
ko.applyBindings(new ViewModel());
为什么剔除不调用函数 checkVisiblity?这个怎么称呼。