vue-types icon indicating copy to clipboard operation
vue-types copied to clipboard

isRequired has unexpected behaviour with func

Open 0biWanKenobi opened this issue 4 years ago • 2 comments

Using vue-types 4.1.1 with Volar extension v. 0.28.9. Somehow a function prop defined with VueTypes.prop.isRequired is still seen as ((...args: any[]) => any) | undefined. Screenshot below:

image

0biWanKenobi avatar Oct 26 '21 08:10 0biWanKenobi

Hmm, I cannot find where this issue comes from. It seems to be only related to the VueTypes.func validator 🤔.

As a quick fix, I suggest you use the individual validator which should not have this issue:

import { func } from 'VueTypes';

// ...

props: {
  toggleCollapsed: func().isRequired
}

dwightjack avatar Oct 27 '21 01:10 dwightjack

Yup, that's what I've done for now, thanks 👍

0biWanKenobi avatar Oct 27 '21 06:10 0biWanKenobi