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

[Alpine v2] Refactor to Better Support Nesting Inside Existing Components #1

Open
pykettk opened this issue Nov 6, 2022 · 0 comments

Comments

@pykettk
Copy link
Owner

pykettk commented Nov 6, 2022

Description

At the moment people will likely struggle with integrating this component as part of another Alpine component given that it defines itself as a component. This should be fine for Alpine v3 but it would be nice to make the integration easier for Alpine v2 users.

Ideas

  • Extract JS into its own file, sans function signature wrapper
  • Either accept block arguments or use the fact that the JS block exists as a child to flag whether the component is/can be nested
    • Conditionally assign the x-data property
    • Conditionally wrap the JS block with its function
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