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's parameter expose is not documented #1064

Closed
wenfangdu opened this issue May 24, 2021 · 1 comment
Closed

setup's parameter expose is not documented #1064

wenfangdu opened this issue May 24, 2021 · 1 comment

Comments

@wenfangdu
Copy link
Contributor

wenfangdu commented May 24, 2021

Couldn't find expose anywhere in the document, please correct me if I'm mistaken.

Taken from https://github.com/vuejs/vue-next/blob/f7c54caeb1dac69a26b79c98409e9633a7fe4bd3/packages/runtime-core/src/component.ts#L179:

export declare interface SetupContext<E = EmitsOptions> {
  attrs: Data
  slots: Slots
  emit: EmitFn<E>
  expose: (exposed: Record<string, any>) => void
}

It's the savior for this type of issues: https://stackoverflow.com/q/67659374/7881859

@skirtles-code
Copy link
Contributor

This is still at the RFC stage and is considered experimental:

vuejs/rfcs#210

It is related to another experimental feature, <script setup>:

vuejs/rfcs#227

In that scenario the context object is accessed using useContext(), allowing access to attrs, slots, emit and expose.

Experimental features are typically not included in the documentation as they are still subject to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants