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
903 stars 97 forks source link

Allow `vfm` to be passed into `<ModalsContainer>` #345

Closed matthew-dean closed 1 year ago

matthew-dean commented 1 year ago

Is your feature request related to a problem? Please describe.

I'm working on some modal stories for Storybook. Storybook has the concept of global decorators; however, these decorators are created / destroyed per story render. This causes a new ModalsContainer to be created, and the modals in the previous ModalsContainer cannot be destroyed in the DOM.

Describe the solution you'd like

const vfm = createVfm()
setup(app => app.use(vfm))

export const decorators = [
  story => ({
    setup() {
      return { vfm }
    },
    components: { story, ModalsContainer },
    template: '<div><story /><ModalsContainer :vfm="vfm" /></div>'
  })
]

Describe alternatives you've considered

I'm not aware of any other alternatives.

Additional context

matthew-dean commented 1 year ago

Never mind, this is the actual issue: https://github.com/vue-final/vue-final-modal/issues/346