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

fix: expose with render function #1067

Merged
merged 1 commit into from
Nov 13, 2021

Conversation

cexbrayat
Copy link
Member

Fixes #1065

When we are testing a component with a render function returned by the setup,
then its proxy will be empty.
The behavior difference can be seen in vue-next here.
In that case, wrapper.vm will be empty if we return vm.$.proxy.
To handle it, we return vm directly for such components,
allowing at least what is exposed publicly to be available on wrapper.vm.

Fixes vuejs#1065

When we are testing a component with a render function returned by the setup,
then its proxy will be empty.
The behavior difference can be seen in vue-next [here](https://github.com/vuejs/vue-next/blob/d19cfc0503dddbded5e599bef0965aba3d25ca28/packages/runtime-core/src/component.ts#L674).
In that case, `wrapper.vm` will be empty if we return `vm.$.proxy`.
To handle it, we return `vm` directly for such components,
allowing at least what is exposed publicly to be available on `wrapper.vm`.
@cexbrayat cexbrayat force-pushed the fix/1065-expose-render-function branch from 80e9390 to 48da341 Compare November 12, 2021 10:08
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

Successfully merging this pull request may close these issues.

VTU doesn't show method exposed via context expose
2 participants