Subscribe on changes!

Boolean type should not have default value

avatar
Oct 9th 2020

Version

3.0.0

Reproduction link

https://jsbin.com/cavekupoco/edit?html,console,output

Steps to reproduce

when set

props: {
   visible: Boolean,
   show: [Boolean, Number],
},
setup(props) {
     console.log("props", props);
},

will get props.visible === false props.show === false

What is expected?

visible and show not in props

What is actually happening?

visible and show is false

avatar
Oct 9th 2020

This is expected behavior as same as v2.

avatar
Oct 10th 2020

@posva @underfin I changed the bug to a feature request. I don't think this is a reasonable design and I hope to modify this default behavior. Especially when there are multiple types.

avatar
Oct 10th 2020

Please check existions issues on vue 2 repo first and if it still makes sense to you open a proper RFC