You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the "type guard" functionality given by v-if effects props and the template but not events.
Example:
In this example I have a ref of an object called selectedDepartment the whole object can be undefined. To eliminate this case I use a v-if as a type guard to check that it is defined before using it inside the template.
This works like a normal if in typescript for the prop and template, but not the event.
I'd expect Volar to reduce the type of selectedDepartment to not be undefined like in the prop:
The text was updated successfully, but these errors were encountered:
Hi,
I noticed that the "type guard" functionality given by v-if effects props and the template but not events.
Example:
In this example I have a ref of an object called
selectedDepartment
the whole object can be undefined. To eliminate this case I use a v-if as a type guard to check that it is defined before using it inside the template.This works like a normal if in typescript for the prop and template, but not the event.
I'd expect Volar to reduce the type of selectedDepartment to not be undefined like in the prop:
The text was updated successfully, but these errors were encountered: