Subscribe on changes!

webcomponent, the passed property is true, but got an empty string ''

avatar
Apr 12th 2022

Version

3.2.31

Reproduction link

sfc.vuejs.org/

image

Steps to reproduce

refer to reproduction

What is expected?

fix the boolean property bug on webcomponent

What is actually happening?

the passed property is true, but got an empty string ''

avatar
Apr 12th 2022

I'm not sure we would rate this a bug as we require boolean props to be properly declared. This works fine: Playground

However we currently are not too explicit about this in the docs, which rather make it sound as if this was optional and only necessary when passing boolean props via attributes:

https://vuejs.org/guide/extras/web-components.html#props

I'll still see if we have a small bug here lurking somewhere.

avatar
Jun 5th 2022

Try replacing . with : , It s work. see: palyground

avatar
Jun 25th 2022

I looked at this again and think the docs are fine as they are - at least I personally don't know how to change them in a way that would make this more clear without being to in-your-face about it.

If you think you see a better way to phrase it, feel free to submit a PR in the docs repo