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

docs(modal): provide an example to bind event listeners #1611

Merged
merged 10 commits into from Apr 10, 2024

Conversation

noook
Copy link
Collaborator

@noook noook commented Apr 4, 2024

πŸ”— Linked issue

#1604

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR adds a new example on how to use event listeners with useModal

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@benjamincanac
Copy link
Member

@noook When looking at the preview, the modal.vue tab is not showing anything. Do you have the same issue locally?

@noook
Copy link
Collaborator Author

noook commented Apr 5, 2024

I noticed it as well, tried to reproduce locally but I can't, it works just fine locally

@benjamincanac benjamincanac changed the title docs(UModal): provide an example to bind event listeners docs(modal): provide an example to bind event listeners Apr 5, 2024
@noook
Copy link
Collaborator Author

noook commented Apr 5, 2024

@benjamincanac This seems to be due to the server returning Nuxt's 404 error page for the requested component instead of the component's code. I wonder what's causing this πŸ€”

Copy link
Member

It might be easier to just display the code group and use the :component-example underneath.

Copy link
Collaborator Author

noook commented Apr 5, 2024

What do you have in mind ? Do you mean using the code group and copy the content of the two files in it, and display the preview underneath ?

The idea was not to have to copy the code so that it is synced with what's actually displayed

Copy link
Member

Then you might have to move them out of the :code-group, not really sure how to fix it at the moment πŸ€”

@noook
Copy link
Collaborator Author

noook commented Apr 10, 2024

@benjamincanac Hacked it πŸ˜‚

I checked what was going on, and it seems that the components meta-data are generated during the pre-rendering, and as the component is only displayed under the second tab it is not shown on pre-render.

This hack just references the component so it is loaded as built time, but it doesn't show anything as there is no code nor preview.

@benjamincanac benjamincanac merged commit d19d707 into nuxt:dev Apr 10, 2024
2 checks passed
@benjamincanac
Copy link
Member

Thanks @noook! 😊

@noook noook deleted the docs/use-modal-event-listener branch April 10, 2024 15:19
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.

None yet

2 participants