Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Tests for emitted events with defineModel #193

Closed
wants to merge 2 commits into from

Conversation

ExEr7um
Copy link
Contributor

@ExEr7um ExEr7um commented May 31, 2023

This pull request could be the starting point for fixing the issue.

@ExEr7um ExEr7um closed this Jun 2, 2023
@ExEr7um ExEr7um deleted the emits-with-defineModel branch June 2, 2023 20:48
@ExEr7um ExEr7um restored the emits-with-defineModel branch June 2, 2023 21:16
@ExEr7um ExEr7um reopened this Jun 2, 2023
@Seboran
Copy link

Seboran commented Sep 15, 2023

I've been trying to solve this PR for quiet a while now... But to no success

What I've found is that, a defineModel uses the currentInstance method in https://github.com/vuejs/core/blob/b775b71c788499ec7ee58bc2cf4cd04ed388e072/packages/runtime-core/src/apiSetupHelpers.ts#L356 and every event will be emitted from this instance through it's uid

But this instance does not correspond to component we are trying to mount, and I don't know where it comes from.

I'm not sure how we can solve this... The only hack I've found is to manually set the vm.vm.$.uid of the wrapper to 16 (the one from which the event is emitted...). But I still don't really understand where it comes from.

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

Successfully merging this pull request may close these issues.

3 participants