DEV Community

zhizhangunai
zhizhangunai

Posted on

How to validate all child node which has the same set of validations?

validations() {
  return {
    formData: {
      name1: {
        rule1,
        rule2
      },
      name2: {
        rule1,
        rule2
      },
      name3: {
        rule1,
        rule2
      },
      name4: {
        rule1,
        rule2
      },
      name5: {
        rule1,
        rule2
      },
    },
  }
}
Enter fullscreen mode Exit fullscreen mode

is there any shorthand I can use? Basically all the child nodes are having the same set of validation rules.

Top comments (0)