Skip to content

Global and local rules cannot be combined #5025

@binairo

Description

@binairo

What happened?

I'm trying to use global and local rules together like this:

<Field
  :rules="{
    required: true,
    myLocalRule    
  }"
/>

But I get the error Error: No such validator 'myLocalRule' exists.

However, if I just use it like this:

<Field
  :rules="myLocalRule"
/>

It works fine.

I've also tried the array syntax:

<Field
  :rules="[
    'required',
    myLocalRule    
  ]"
/>

But that gives the error TypeError: rule is not a function

This might be related to the discussion here: #4705
and this issue #4058 (which is closed but seems like it's still not working?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions