我正在从其官方网站学习淘汰赛,这是我从网站上获取的教程
// This is a simple *viewmodel* - JavaScript that defines the data and behavior of your UI
function AppViewModel() {
this.firstName = ko.observable('');
this.lastName = ko.observable("Bertington");
this.fullName = ko.computed(function() {
return this.firstName() + " " + this.lastName();
}, this);
}
// Activates knockout.js
ko.applyBindings(new AppViewModel());
我想问一下将这个作为参数传递给计算函数的目的是什么
ko.computed(function() {
return this.firstName() + " " + this.lastName();
}, this);
谢谢