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
When defineComponent uses the function signature method, the expose function loses its type #10873
Comments
fslflame
changed the title
defineComponent The expose type in ctx is lost in function signature writingff
When defineComponent uses the function signature method, the expose function loses its type
May 6, 2024
I don't think there is a fix for this, since it's impossible to infer the type passed to The workaround is exporting your expose type as a separate interface: import { defineComponent } from 'vue';
export inteface Exposed {
getClipDataURL: number
}
export default defineComponent((_, { expose }) => {
expose({
getClipDataURL: 1,
} as Exposed);
return () => <div>8888</div>;
}); And in other components, import the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vue version
3.4.21
Link to minimal reproduction
https://github.com/fslflame/demo
Steps to reproduce
What is expected?
defineExpose and expose should be consistent
What is actually happening?
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: