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

Sharing setActive with child components #10

Open
gruppler opened this issue Dec 11, 2024 · 1 comment
Open

Sharing setActive with child components #10

gruppler opened this issue Dec 11, 2024 · 1 comment

Comments

@gruppler
Copy link

gruppler commented Dec 11, 2024

How should I pass the setActive function to a child component? The setup script can't contain exports, and when I initialize outside a component, I get onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement..

@gruppler
Copy link
Author

I was able to work around this by emitting events from the child components and listening for them with a proxy function in the parent component.

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

1 participant