vue-modal-service

Simple modal service for (vue 2 || nuxt)
632 3
Install
npm install vue-modal-service
Latest Version:1.4.3
Vue:2
Last Updated:Mar 30, 2022
Links: GitHub  ·  npm
Maintainer: abylail

vue-modal-service

Install

npm i vue-modal-service

Quick 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|small

Show 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.$payload

Hide modal

this.$modal.hide('some-modal-name');

Emits

<modal @onShow="someMethod" ...
<modal @onHide="someMethod" ...

How to debug

Available modals

this.$modal.$availableModals

Active modal name

this.$modal.$active

Queue of hidden modal

this.$modal.$queue

Related Packages

vuedl

Vue dialog helper

17,871 29
vue-bootstrap-modal

Bootstrap Style Modal for Vue

1,808 146
vue-final-modal

The most powerful yet most light-weight modal library for Vue 3.

3,105,553 1,013
vue-js-modal

Modal Component for Vue.js

2,806,831 4,307
jenesius-vue-modal

The progressive and simple modal system for Vue.js v3

198,410 159

Version History

Version Released Vue License
1.4.3 ^2.6.11
1.4.2 ^2.6.11
1.4.1 ^2.6.11
1.4.0 ^2.6.11
1.3.3 ^2.6.11