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

vue-component-meta, exposed contains all slots, props and events as well #5005

Open
fbecker-fds opened this issue Nov 13, 2024 · 3 comments
Open

Comments

@fbecker-fds
Copy link

Vue - Official extension or vue-tsc version

latest

VSCode version

Not used here

Vue version

latest

TypeScript version

3.5.12

System Info

No response

package.json dependencies

No response

Steps to reproduce

Run the tests of this repository after adding the following in line 702:

expect(meta.exposed.length).toBe(1);

What is expected?

It should pass

What is actually happening?

It fails because exposed contains way more than just the exposed symbol.

Link to minimal reproduction

https://github.com/vuejs/language-tools/blob/master/packages/component-meta/tests/index.spec.ts#L691-L704

Any additional comments?

No response

@KazariEX
Copy link
Collaborator

It passed on my end.

image

@fbecker-fds
Copy link
Author

Apologies! I forgot to mention that the following change is required as well (otherwise there is nothing besides the one expose that could end up in the exposed array :-)):

test-workspace/component-meta/reference-type-exposed/component.vue

Add defineProps(["testProp"]);

Result:
image

@Dtsiantaris
Copy link

I encountered this behavior using [email protected].

The exposed contains:

  • All defined props.
  • $slots
  • events prefixed with 'on'(i.e. an emit defined as 'update:filtered' will be 'onUpdate:filtered'

There is no way currently to filter them and just get the exposed.

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

No branches or pull requests

3 participants