UNPKG

1.98 kBMarkdownView Raw
1# Overview
2mint-popup is a popup component for vue.js
3
4# Installation
5First, install `mint-popup` from npm:
6```bash
7$ npm install mint-popup
8```
9
10Import it:
11```Javascript
12require ('mint-popup/lib/index.css');
13
14// ES6 mudule
15import Popup from 'mint-popup';
16
17// CommonJS
18const Popup = require('mint-popup').default;
19```
20
21Register component:
22```Javascript
23Vue.component('popup', Popup);
24```
25
26Then use it:
27```html
28<popup :visible.sync="popupVisible" position="bottom"></popup>
29```
30
31# Usage
32`position` defines the location of the popup. If it's `bottom`, when you switch on the popup, it'll slide into the screen from the bottom and become fixed at the bottom.
33
34If the `position` attribute is omitted, the popup will be located at the center of the viewport (and of course you can relocate it using CSS). In this case, you may want to set its `popup-transition` attribute to `popup-fade` so that it'll have a fading effect when switched on/off.
35
36Sync `visible` with one of your vue instance variables. Toggle it to switch on/off the popup.
37
38# API
39| Option | Description | Value | Default |
40|-------------------|-------------------------------------------------------------|-------------------------------|---------------|
41| visible | visibility of the popup | Boolean | 'false' |
42| position | location of the popup | 'top' 'right' 'bottom' 'left' | |
43| pop-transition | CSS transition of the popup | 'popup-fade' 'popup-slide' | 'popup-slide' |
44| modal | determines if a modal pops with the popup | Boolean | true |
45| closeOnClickModal | determines if the popup turns off when the modal is clicked | Boolean | true |
46
47# License
48MIT