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

How do I get instances of slot components? #438

Open HenryOoO opened 6 months ago

HenryOoO commented 6 months ago

Version

vue-final-modal: ^4.5.4 vue: ^3.4.21

Description

I am a vue novice, I created a public style pop-up window MyModal, inside the OK button, I want to click the OK button to get the Form inside the child component form, can this be achieved?


<script lang='ts' setup>
import Form from '@/components/Form.vue';
import MyModal from '@/components/MyModal.vue';
import { useModal } from 'vue-final-modal';

const { open, patchOptions } = useModal({ component: MyModal, keepAlive: false, attrs: { title: 'my modal', "onSave": () => { // How do I get the value inside the form here? } }, slots: { default: Form }, })