Skip to content

Commit 4df023f

Browse files
Yeveuvl
authored andcommitted
Updated SSR
1 parent 04e84c7 commit 4df023f

File tree

8 files changed

+54
-35
lines changed

8 files changed

+54
-35
lines changed

docs/.vuepress/config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ module.exports = {
99

1010
sidebar,
1111
nav: [
12-
{
13-
text: 'Sponsorship',
14-
link: 'https://github.com/sponsors/euvl'
15-
},
1612
{ text: 'Github', link: 'https://github.com/euvl/vue-js-modal' },
1713
{ text: 'Examples', link: '/examples/' }
1814
]

docs/.vuepress/sidebar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ module.exports = [
66
'/Installation',
77
'/Usage',
88
'/API',
9-
'/Configuration',
10-
'/Properties',
119
'/Events',
10+
// '/Configuration',
11+
'/Properties',
1212
'/Slots',
13-
'/FAQ'
13+
'/Other'
1414
]
1515
}
1616
]

docs/Installation.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
---
2-
sidebarDepth: 0
3-
---
4-
5-
## Installation
1+
# Installation
62

73
```bash
84
npm install vue-js-modal --save
95
```
106

7+
```bash
8+
yarn add vue-js-modal
9+
```
10+
11+
## Client
12+
1113
Import plugin in your main file:
1214

1315
```js
@@ -16,19 +18,35 @@ import VModal from 'vue-js-modal'
1618
Vue.use(VModal)
1719
```
1820

19-
Or as a Nuxt.js plugin:
21+
## SSR
22+
23+
To use this plugin with Nuxt.js you need to create a plugin file and reference it in the `nuxt.config.js` file.
24+
25+
```js
26+
// nuxt.config.js
27+
export default {
28+
...
29+
/*
30+
** Plugins to load before mounting the App
31+
*/
32+
plugins: [
33+
'~plugins/vue-js-modal.js'
34+
],
35+
}
36+
```
2037

2138
```js
39+
// plugins/vue-js-modal.js
2240
import Vue from 'vue'
23-
import VModal from 'vue-js-modal/dist/ssr.nocss'
41+
import Modal from 'vue-js-modal/dist/ssr.nocss'
2442

25-
// import from 'vue-js-modal/dist/styles.css
43+
import 'vue-js-modal/dist/styles.css'
2644

27-
Vue.use(VModal)
45+
Vue.use(VModal, { ... })
2846

29-
export default function(_, inject) {
30-
inject('modal', VModal)
31-
}
47+
// export default function(_, inject) {
48+
// inject('modal', VModal)
49+
// }
3250
```
3351

3452
::: tip Extracted CSS

docs/FAQ.md renamed to docs/Other.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FAQ
1+
# Other
22

33
## Sponsorship
44

docs/Properties.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Draggable property can accept String parameters. With String value, you can spec
4242

4343
Enables scroll within the modal when the height of the modal is greater than the screen.
4444

45-
::: warning
45+
::: warning Note
4646
This feature only works when `height` is set to `"auto"`
4747
:::
4848

@@ -104,7 +104,7 @@ List of class that will be applied to the modal window (not overlay, just the bo
104104
Style that will be applied to the modal window.
105105

106106

107-
::: warning
107+
::: warning Note
108108
To be able to support string definition of styles there are some hacks in place.
109109

110110
Vue.js does not allow merging string css definition with an object/array style definition. There are very few cases where you might need to use this property, but if you do - write tests :)
@@ -118,7 +118,7 @@ Width in pixels or percents (50, "50px", "50%").
118118

119119
Supported string values are `<number>%` and `<number>px`
120120

121-
::: warning
121+
::: warning Note
122122
This is not CSS size value, it does not support `em`, `pem`, etc. Plugin requires pixels to recalculate position and size for draggable, resaziable modal.
123123
If you need to use more value types, please consider contributing to the parser [here](https://github.com/euvl/vue-js-modal/blob/master/src/utils/parser.js).
124124
:::
@@ -131,6 +131,11 @@ Height in pixels or percents (50, "50px", "50%") or `"auto"`.
131131

132132
Supported string values are `<number>%`, `<number>px` and `auto`. Setting height to `"auto"` makes it automatically change the height when the content size changes (this works well with `scrollable` feature).
133133

134+
::: warning Note
135+
This is not CSS size value, it does not support `em`, `pem`, etc. Plugin requires pixels to recalculate position and size for draggable, resaziable modal.
136+
If you need to use more value types, please consider contributing to the parser [here](https://github.com/euvl/vue-js-modal/blob/master/src/utils/parser.js).
137+
:::
138+
134139
---
135140

136141
`minWidth: Number (pixels)` `default: 0`

docs/Usage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ this.$modal.show(
5454
* `modal_properties` -modal component properties (see Properties section)
5555
* `modal_events` - modal event handlers (see Events section)
5656

57-
5857
Using **imported** component definition:
5958

6059
```js
@@ -98,11 +97,12 @@ export default {
9897
}
9998
```
10099

100+
101101
## Dialogs
102102

103-
Dialog is a simplified version of the modal which has most parameters set by default and is useful for quick prototyping, showing alerts etc.
103+
Dialog is a simplified version of the modal which has most parameters set by default and is useful for quick prototyping, alerts, etc.
104104

105-
To start using dialogs you must set dialog: true in plugin configuration:
105+
To start using dialogs you must set `dialog: true` in plugin configuration:
106106

107107
```js
108108
Vue.use(VModal, { dialog: true })

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@
6262
"sass-loader": "^7.1.0",
6363
"ts-loader": "^6.2.2",
6464
"uglifyjs-webpack-plugin": "^2.2.0",
65-
"vue": "2.6.10",
65+
"vue": "2.6.11",
6666
"vue-hot-reload-api": "^2.0.8",
6767
"vue-jest": "^3.0.1",
6868
"vue-loader": "^15.0.0",
6969
"vue-style-loader": "^4.1.2",
70-
"vue-template-compiler": "2.6.10",
70+
"vue-template-compiler": "2.6.11",
7171
"vue-test-utils": "^1.0.0-beta.11",
7272
"webpack": "^4.42.1",
7373
"webpack-cli": "^3.3.11",
7474
"webpack-merge": "^4.2.2",
7575
"vuepress": "^1.5.2"
7676
},
7777
"peerDependencies": {
78-
"vue": "2.6.10"
78+
"vue": "2.6.11"
7979
},
8080
"dependencies": {
8181
"resize-observer-polyfill": "^1.5.1"

0 commit comments

Comments
 (0)