Closed
Description
We know that Vue will assign undefined to props that do not have a default value, but it still exists in propsOptions in the form of key value, and for TypeScript, optional parameters and parameters are of other types or undefined are two different definitions , It caused me to use toRefs for props in the setup function to make the parameters in the props become Ref | undefined, and I had to make assertions on the parameters, but it actually exists.
type Props = {
a?: number
b: number | undefined
}
type ToRefsProps = ToRefs<Props>
They are like Props.a and Props.b,In Vue, my parameters exist in the type of Props.b, but in the setup I get the type like Props.a.