vue-modal-service
v1.4.3
Published
Simple modal service for (vue 2 || nuxt)
Downloads
100
Maintainers
Readme
vue-modal-service
Install
npm i vue-modal-serviceQuick Start
import it to global css
@import "~vue-modal-service/dist/modal-service.css";
OR
(for NUXT)
css: [
"vue-modal-service/dist/modal-service.css",
],import Vue from 'vue';
import ModalService from 'vue-modal-service';
Vue.use(ModalService);How to use
Creating modal
<modal name="some-modal-name" size="middle" close-button>
<div>hey</div>
</modal>Available sizes
large|big|middle|smallShow modal
this.$modal.show('some-modal-name');Set data in modal
How open modal with some data
-> payload is any that you need
this.$modal.show('some-modal-name', payload); <-
You can get it in this.$modal.$payloadHide modal
this.$modal.hide('some-modal-name');Emits
<modal @onShow="someMethod" ...
<modal @onHide="someMethod" ...How to debug
Available modals
this.$modal.$availableModalsActive modal name
this.$modal.$activeQueue of hidden modal
this.$modal.$queue