mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 09:50:22 +00:00
Updated README
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
package-lock.json
|
||||
*.map
|
||||
|
||||
31
README.md
31
README.md
@@ -18,7 +18,7 @@ npm install vue-js-modal --save
|
||||
|
||||
### How to use
|
||||
|
||||
Include plugin in your main.js file.
|
||||
Include plugin in your `main.js` file.
|
||||
|
||||
```javascript
|
||||
import vmodal from 'vue-js-modal'
|
||||
@@ -26,13 +26,15 @@ import vmodal from 'vue-js-modal'
|
||||
Vue.use(vmodal)
|
||||
```
|
||||
|
||||
Create modal
|
||||
Create modal:
|
||||
|
||||
```html
|
||||
<modal name="hello-world">
|
||||
hello, world!
|
||||
</modal>
|
||||
```
|
||||
Call it from anywhere in the app
|
||||
Call it from anywhere in the app:
|
||||
|
||||
```javascript
|
||||
methods: {
|
||||
show () {
|
||||
@@ -44,6 +46,27 @@ methods: {
|
||||
}
|
||||
```
|
||||
|
||||
### SSR
|
||||
|
||||
Include plugin in your `nuxt.config.js` file:
|
||||
|
||||
```javascript
|
||||
module.exports = {
|
||||
plugins: ['~plugins/vue-js-modal']
|
||||
}
|
||||
```
|
||||
|
||||
And your `plugins/vue-js-modal.js` will look like:
|
||||
|
||||
```javascript
|
||||
import Vue from 'vue'
|
||||
import VModal from 'vue-js-modal/dist/ssr.index'
|
||||
|
||||
Vue.use(VModal)
|
||||
```
|
||||
|
||||
For full demo please look at `demo/server_side_rendering`
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Required | Type | Default | Description |
|
||||
@@ -172,5 +195,3 @@ cd demo
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
import VModal from 'vue-js-modal/dist/ssr.index.js'
|
||||
import VModal from 'vue-js-modal/dist/ssr.index'
|
||||
|
||||
Vue.use(VModal)
|
||||
|
||||
Reference in New Issue
Block a user