Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miaowing/vue-modal
A simple modal plugin for vue.js
https://github.com/miaowing/vue-modal
modal vue vue-modal vue-plugin
Last synced: 18 days ago
JSON representation
A simple modal plugin for vue.js
- Host: GitHub
- URL: https://github.com/miaowing/vue-modal
- Owner: miaowing
- Created: 2015-09-22T07:29:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-05T08:25:02.000Z (almost 8 years ago)
- Last Synced: 2024-10-24T10:11:36.574Z (22 days ago)
- Topics: modal, vue, vue-modal, vue-plugin
- Language: JavaScript
- Homepage: https://miaowing.me/vue-modal
- Size: 103 KB
- Stars: 17
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-modal-plugin
#### Usage
```
npm install vue-modal-plugin --save
```#### init modal
```javascript
var Vue = require('vue'),
VueModal = require('vue-modal-plugin');// regist vue-modal plugin
Vue.use(VueModal);// initial vue-modal
var modal = Vue.modal({
target: element // insert modal element into target element which is child element of target element.
template: template, // vue-modal template, type string.
data: {},
methods:{},
autoDestroy: false // when the value is true, you won't need to invoke destroy().
});
```#### template
```html
{{modal.title}}
{{modal.content}}
```#### open
```javascript
modal.open();
```#### close
```javascript
modal.close();
```####destroy
```javascript
modal.destroy();
```#### update
```javascript
modal.udpate({
// data
})
```####demo
https://miaowing.me/vue-modal/example/index.html