Skip to content

setup expose, component should have typescript declaration #4876

Closed
@xiaoxiangmoe

Description

@xiaoxiangmoe
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions