How to use ko.validation.group function

前端 未结 2 378
我寻月下人不归
我寻月下人不归 2020-12-13 00:39

I am trying to use knockout.validation plugin. I created an exampleViewModel :

function exampleViewModel() {
   this.P1 = ko.observable().extend({ required :         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 01:13

    As described in the documentation the right way to validate only specific observables is:

    this.errors = ko.validation.group([this.P1, this.P2, this.P3]);
    

提交回复
热议问题