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
Volar incorrectly errors if you're using an empty attribute to target a non-boolean prop.
Here you can see Type 'true' is not assignable to type 'string | undefined':
It assumes that empty attribute are true, which is not compatible with string but that's not an accurate representation of runtime behavior.
Vue only coalesces an empty attribute into true if the target prop is typed as a boolean.
If the target prop is a string, then no conversion occurs and it's set to an empty string.
So in the example above, confirm is set to the value "", which is assignable to type string | undefined
The text was updated successfully, but these errors were encountered:
Volar incorrectly errors if you're using an empty attribute to target a non-boolean prop.
Here you can see
![image](https://user-images.githubusercontent.com/3832820/121582573-73ccb000-ca2f-11eb-990c-473e4ac90696.png)
Type 'true' is not assignable to type 'string | undefined'
:It assumes that empty attribute are
true
, which is not compatible withstring
but that's not an accurate representation of runtime behavior.Vue only coalesces an empty attribute into
true
if the target prop is typed as aboolean
.If the target prop is a
string
, then no conversion occurs and it's set to an empty string.So in the example above,
confirm
is set to the value""
, which is assignable to typestring | undefined
The text was updated successfully, but these errors were encountered: