Skip to content
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

setup expose, component should have typescript declaration #4876

Closed
xiaoxiangmoe opened this issue Oct 29, 2021 · 1 comment
Closed

setup expose, component should have typescript declaration #4876

xiaoxiangmoe opened this issue Oct 29, 2021 · 1 comment

Comments

@xiaoxiangmoe
Copy link
Contributor

import { defineComponent, ref, Ref } from 'vue';

const Hello = defineComponent({
    props: { msg: String },
    setup: (props, { expose }) => {
        const count: Ref<number> = ref(0);
        expose({ a: 1, b: 2 });
        return () => <div>{count.value} </div>;
    },
});

declare const hello: InstanceType<typeof Hello>;

image

a and b are not exposed.

releated issue:
#4397

@posva
Copy link
Member

posva commented Oct 29, 2021

Duplicate of #4397
Don't skip the issue template

@posva posva closed this as completed Oct 29, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants