Jenesius Vue Modal
For add modal in your project you need to put modal's container to App component:
<template>
<widget-container-modal />
</template>
<script>
import {container} from "jenesius-vue-modal";
export default {
components: {WidgetContainerModal: container},
name: "App"
}
</script>
OpenModal
import {openModal} from "jenesius-vue-modal";
openModal(VueComponent, props);
OR
Function name | Description |
---|
openModal(VueComponent, props) | Close ny other modals and then open modal that provided |
closeModal() | Close all modals |
pushModal(VuewComponent, props) | Add on top modal component |
popModal() | Close the last modal component |
Example VueModalComponent
WidgeTestModal.vue
<template>
<p>{{title}}</p>
</template>
<script>
export default {
props: {
title: String
}
}
</script>
For show this component
import useModal from "jenesius-vue-modal"
import WidgeTestModal from "WidgeTestModal.vue";
const {openModal} = useModal();
openModal(WidgeTestModal, {
title: "Hello World!"
});