-
Notifications
You must be signed in to change notification settings - Fork 141
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
请问如何暴露函数给父组件这个写法,有解吗? #626
Comments
ctx.expose({
myClick,
}); |
you can paste my code to your ide , expose is not defined in ctx @funny-family |
@Charlie500, that is why. export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}>
extends ComponentInternalOptions {
// use of any here is intentional so it can be a valid JSX Element constructor
(props: P, ctx: Omit<SetupContext<E>, 'expose'>): any
props?: ComponentPropsOptions<P>
emits?: E | (keyof E)[]
inheritAttrs?: boolean
displayName?: string
compatConfig?: CompatConfig
} Try to console log |
@Charlie500, or you can try use |
纯函数不行。我刚看了一下代码,你定义到defineComponent里面的setup应该可以 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: