-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prop required and starts with on
's type is broken in ts 4.7
#6052
Labels
Comments
It's a broken in ts 4.7. I have some workaround: index.ts import { defineComponent } from "vue";
defineComponent({
props: {
onX: {
type: Function,
required: true,
},
},
setup(props) {
props.onX!();
},
}); or tsconfig.json {
"compilerOptions": {
"strict": false
}
} Hope this helps. |
We should report this issue to TS |
I tried to change the LooseRequired to the following code and it works fine. But I don't know how to make it work with Vue. export type LooseRequired<T> = { [P in keyof Required<T>]: T[P] } |
/cc @pikax |
Is there any progress? I think the problem may stop some projects migrating to ts 4.7. |
yyx990803
pushed a commit
that referenced
this issue
Jul 6, 2022
chrislone
pushed a commit
to chrislone/core
that referenced
this issue
Feb 4, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.2.36
Link to minimal reproduction
nope
Steps to reproduce
index.ts
package.json
Run
npm run build
What is expected?
No error
What is actually happening?
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: