Nuxt2mo ago

Pop-up Components

If I wanted to build a reusable component that acts as a modal and overlays anything going on beneath it, how would I do it? Specifically, how do I ensure everything "beneath" it has the proper z index, relevant to my modal component? And what is it called when you develop a specific use case component and make it available for others to add to their projects? Is this a plugin? I've only ever built my own projects. Never worked on something that someone else might some day use. Any advice would be super helpful. Thank you in advance - you're awesome.
1 Reply
Tirius2mo ago
For proper z-index you can try to use Teleport component https://vuejs.org/guide/built-ins/teleport.html For something reusable you could make a Nuxt module. https://nuxt.com/docs/api/kit/modules
Vue.js - The Progressive JavaScript Framework
Modules · Nuxt Kit
Nuxt Kit provides a set of utilities to help you create and use modules. You can use these utilities to create your own modules or to reuse existing modules.