Closed
Description
Vue version
3.2.45
Link to minimal reproduction
Steps to reproduce
Here, we get show
type as Ref<boolean>
however in VS Code it is Ref<boolean | undefined>
🤔
- check the type of the boolean in autosuggestion as shown in image
What is expected?
It should have property type as Ref according to this: https://vuejs.org/guide/components/props.html#prop-validation
The Boolean absent props will be cast to false. You can change this by setting a default for it — i.e.: default: undefined to behave as a non-Boolean prop.
What is actually happening?
It is getting type as Ref<boolean|undefined>
where undefined
is invalid.
System Info
System:
OS: macOS 12.5.1
CPU: (8) arm64 Apple M1
Memory: 101.03 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Browsers:
Chrome: 105.0.5195.102
Safari: 15.6.1
npmPackages:
vue: 3.2.45 => 3.2.45
Any additional comments?
Original Issue: vuejs/language-tools#2219