Wrong optional type in setup props for prop that default value is null
Version
3.0.11
Reproduction link
https://codesandbox.io/s/wonderful-frog-2wp60?file=/src/index.ts:0-189
Steps to reproduce
follow the link
import { defineComponent } from "vue";
defineComponent({
props: {
notUndefined: {
type: Number,
defualt: null
}
},
setup(props) {
props.notUndefined;
}
});
What is expected?
notUndefined should not be optional
What is actually happening?
notUndefined is optional
need
required:true
option ?
In runtime it can't be undefined
or just not in the keys, so I think required: true
is just a workaround.
Also it may cause runtime warning.