Closed
Description
The docs specifies the following:
<!-- Including the prop with no value will imply `true`. -->
<blog-post favorited></blog-post>
In my brain this tells me to do the following:
<blog-post favorited></blog-post>
export default {
name: 'blog-post',
props: {
favorited: false,
}
}
This results in the prop favorited
equals to ""
== empty string. Not true
I know that in order to get this to work, one has to declare the prop of type boolean instead:
export default {
name: 'blog-post',
props: {
favorited: Boolean,
}
}
One could argue that the title of the doc snippet; "Passing a Boolean" should be enough for the end user to "know what to do". However, for people new to vue, I think this is expecting too much. 🤔
Metadata
Metadata
Assignees
Labels
No labels