Skip to content

Commit 15288f9

Browse files
committed
(docs) migrate docs
1 parent 6573047 commit 15288f9

File tree

4 files changed

+21
-27
lines changed

4 files changed

+21
-27
lines changed

docs/Installation.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
# Installation
22

33
```bash
4-
npm install vue-js-modal --save
5-
```
6-
7-
```bash
8-
yarn add vue-js-modal
4+
npm install @febe95/vue-js-modal --save
95
```
106

117
## Client
128

139
Import plugin in your main file:
1410

1511
```js
16-
import VModal from 'vue-js-modal'
12+
import VModal from '@febe95/vue-js-modal'
1713

1814
OR
1915

20-
import VModal from 'vue-js-modal/dist/index.nocss.js'
21-
import 'vue-js-modal/dist/styles.css'
16+
import VModal from '@febe95/vue-js-modal/dist/index.nocss.js'
17+
import '@febe95/vue-js-modal/dist/styles.css'
2218
```
2319

2420
```js
25-
Vue.use(VModal)
21+
app.use(VModal)
2622
```
2723

2824
## SSR
@@ -44,16 +40,14 @@ export default {
4440

4541
```js
4642
// plugins/vue-js-modal.js
47-
import Vue from 'vue'
48-
import VModal from 'vue-js-modal/dist/ssr.nocss'
43+
import { defineNuxtPlugin } from 'nuxt/app'
44+
import VModal from '../../../dist/ssr.nocss'
4945

50-
import 'vue-js-modal/dist/styles.css'
46+
import '../../../dist/styles.css'
5147

52-
Vue.use(VModal, { ... })
53-
54-
export default function(_, inject) {
55-
inject('modal', Vue.prototype.$modal)
56-
}
48+
export default defineNuxtPlugin((nuxtApp) => {
49+
nuxtApp.vueApp.use(VModal)
50+
})
5751
```
5852

5953
::: tip Extracted CSS

docs/Intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ this.$modal.show({
105105
It is possible to set default property values for dynamic modals:
106106

107107
```js{4-8}
108-
import VModal from 'vue-js-modal'
108+
import VModal from '@febe95/vue-js-modal'
109109
110-
Vue.use(VModal, {
110+
app.use(VModal, {
111111
dynamicDefaults: {
112112
draggable: true,
113113
resizable: true,
@@ -121,7 +121,7 @@ Vue.use(VModal, {
121121
Dialog is a simplified version of the modal which has most parameters set by default and is useful for quick prototyping, alerts, etc. Dialog is merely an example of how easy it is to create modals that fit your project needs. Nevertheless, you can use it if you set `dialog: true` in plugin configuration:
122122

123123
```js
124-
Vue.use(VModal, { dialog: true })
124+
app.use(VModal, { dialog: true })
125125
```
126126

127127
And include this component in your project:

docs/Other.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Please consider sponsoring this project through [Github Sponsorship](https://git
1010
# Clone repo
1111
git clone https://github.com/febe95/vue-js-modal.git
1212

13-
# Run unit tests
14-
npm run unit
13+
# Run tests
14+
npm run test
1515

1616
# Run linter
17-
npm run lint
17+
npm run lint:js
1818

1919
# Build main library for client & SSR
2020
cd vue-js-modal

docs/Usage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ sidebarDepth: 2
66

77
## Configuration
88

9-
Configuration options can be passed as a second argument to `Vue.use`.
9+
Configuration options can be passed as a second argument to `app.use`.
1010

1111
```js
1212
import VModal from 'vue-js-modal'
1313

14-
Vue.use(VModal, { ... })
14+
app.use(VModal, { ... })
1515
```
1616

1717
#### `dialog: Boolean`
@@ -27,7 +27,7 @@ Enables [dialogs](Intro#dialogs).
2727
Changes component name from "Modal" to any other string value. It is useful when there is already a global "modal" component.
2828

2929
```js
30-
Vue.use(VModal, { componentName: 'Foo' })
30+
app.use(VModal, { componentName: 'Foo' })
3131
```
3232
```html
3333
<foo name="example">This is a modal</foo>
@@ -42,7 +42,7 @@ Vue.use(VModal, { componentName: 'Foo' })
4242
Default properties that are injected into dynamic modals.
4343

4444
```js
45-
Vue.use(VModal, { dynamicDefaults: { draggable: true, resizable: true } })
45+
app.use(VModal, { dynamicDefaults: { draggable: true, resizable: true } })
4646
```
4747

4848
## API

0 commit comments

Comments
 (0)