vue-final / vue-final-modal

🍕Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.
https://vue-final-modal.org
MIT License
864 stars 95 forks source link

Can i not pass any property to modals like we used to using $vfm.show('modal-name', {key: value}) ? #363

Closed dipuahmed018 closed 7 months ago

dipuahmed018 commented 1 year ago

Trying to do the same thing with vue-final-modal 4 but open method does not accept any second argument. Is dynamic modal the only option I have?

vfm.open('notification', { notification: "Hello wolrd!" })

hunterliu1003 commented 7 months ago

In vue-final-modal 4, the only way to define a dynamic modal is useModal()

For example:

const { open } = useModal({
  component: NotificationModal,
  attrs: {
    notification: "Hello world!"
  }
})

open()

Check the useModal() example https://v4.vue-final-modal.org/use-cases/modal-nested and stackblitz live demo