Subscribe on changes!

defineProps set optional property's value to default

avatar
May 18th 2023

Vue version

3.3.4

Link to minimal reproduction

https://play.vuejs.org/#eNpVkE9Lw0AQxb/KM5ekUFu8ljQiRRAPIijqIZe2maQL+4/dSUDSfHcnqUa9zZud/b2Z1yd33q+6lpJNksdjUJ4RiVsPvbfNtkw4lklRWmW8C4wegWos355cRbuT0tWAOjiDVAhpaYHS8qcnYBx4naotEDko2wBn2NYcKEhxcE7TXj6c8fjysbrXZMiyqJ0TJ3ups2yBbYFft0Vpj85Ghg/OR0FXVCtLz6PK+05FddB0u/mhL1nxqOdlhiKbESY2ApBzsvSBtHZ4d0FXV6kM5OtLEnK3CCbj9Z5JFJCfboq+x7cVhiFfS+fPy2T5r6+sbxndtZEttCQqxlOk+XomJ8MXRoWGVw==

Steps to reproduce

title and visible should be optional and it's ok before 3.3

What is expected?

should be undefined

What is actually happening?

false

System Info

No response

Any additional comments?

No response

avatar
May 19th 2023

Also note: it is expected behavior for both props to be false here because they both are either boolean or contains boolean in its union: https://vuejs.org/guide/components/props.html#boolean-casting

avatar
May 19th 2023

but it's will be undefined if I change the type name and run it (means it's first defined type in vscode) but when I close vscode and re-run it, still be false again