ko.computed property to determine visibility not working

前端 未结 3 1960
死守一世寂寞
死守一世寂寞 2021-01-23 07:38

In my KncokoutJS ViewModel, I have the follow computed property:

self.SelectedUserHasRoles = ko.computed(function () {
  if (self.isLoaded()) {
    return self.s         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-23 08:19

    You have the same check for isLoaded() twice, actually

    
      
    

    if isLoaded() evalutes to false, your SelectedUserHasRoles() won't even be evaluated.

提交回复
热议问题