Closed noook closed 10 months ago
+1
@noook @samb1999
You can still use useModal()
to replace all of the dynamic modals by using options API.
useModal()
is allowed to be used in both setup script
and Options API
.
Here is an example that use Nuxt 3 and Options API:
https://stackblitz.com/edit/github-1brl3g?file=components%2FMyModalPreview.vue
Version
vue-final-modal: 4.0.11 vue: 3.2 nuxt: 3.2.3
Question
We are migrating from
vue-js-modal
where all of our modals were created dynamically. We are migrating from a Nuxt 2 to a Nuxt 3 project, so most of our code is written in Options API, so using asetup
in order to useuseModal()
cannot work as setup is invoked before the other hooks and won't be able to refer to the component's data.I was wondering if there is still any way to create the modals dynamically in the options API, and if so, how ?
If not, do you plan to reintroduce this feature ?