DEV Community

Discussion on: Create modals with Vue3 Teleport + TailwindCSS

Collapse
 
atinybeardedman profile image
Sean Dickinson

I'm wondering if this could be simplified a bit. For instance we not use v-model to control the state of the modal and just emit an event when it should be closed? I seem to have it working fairly well this way.

Also, the clickOutside composition I'm sure has much better accessibility, but as a quick and dirty solution I usually add a @click.prevent to the div that has the modal content and then an actual click listener on the close icon and the backdrop to close the modal.