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

listen for and emit custom events on dynamic modal #785

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mrkwdwrd
Copy link

@mrkwdwrd mrkwdwrd commented Oct 12, 2022

I was using a Single-File Component in a dynamic modal and found I needed trigger a method on the component that was invoking the modal, from within the component in the modal, but I don't want it tied to any of the existing modal events.

I've created a custom-event listener on the modal which accepts an object containing the name of the event I ultimately want to listen for and and object of params (optional).

On the SFC shown in the modal, I emit the custom-event back to the parent:

image

And I've invoked the modal as follows and the my-custom-event listener as follows:

image

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.

1 participant