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
862 stars 95 forks source link

Updating contents (slots) of the modal #437

Open Arrig0 opened 3 months ago

Arrig0 commented 3 months ago

Version

vue-final-modal: v4.5.4 vue: v3 nuxt: v3.11

OS

Linux

Question

Sorry for the (maybe) trivial question, but how can I dynamically update the contents (slots) of the modal? I tried with some text via ref(), but it doesn't work.

Thanks in advance

Arrig0 commented 3 months ago

My question is the same documented here: https://github.com/vue-final/vue-final-modal/issues/429

I would also need reactive props/attrs.

Arrig0 commented 3 months ago

Sorry, if I had read more issues, I would have solved it (https://github.com/vue-final/vue-final-modal/issues/357)

I suggest that this reactivity question should be better documented.

const msg = ref('a message');
.....
slots: {
    default: computed(() => msg.value), 
  }