Skip to content

Cannot find prop, when prop has a validator. #93

@MatthijsBe

Description

@MatthijsBe

Hi,

Just switched to volar, and so far I love it 💯.

But I got a strange error: inside an v-if I check the value of a prop, but volar will say: Cannot find name 'selectionVariant'"

the prop looks like this:

  props: {
    selectionVariant: {
      type: String,
      required: true,
      validator: function (value: string) {
        return ['dropdown', 'tiles'].indexOf(value) !== -1
      }
    }
  },

But when I remove the validator, the error is gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions