Skip to content

Commit 4faf85c

Browse files
committed
docs: update contribution section
1 parent df7f30e commit 4faf85c

File tree

2 files changed

+35
-201
lines changed

2 files changed

+35
-201
lines changed

README.md

Lines changed: 28 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ Looking for a Vue 3 version? [It's over here](https://github.com/hunterliu1003/v
3636

3737
You can create a [higher-order component](https://vue-final-modal.org/examples/recommended-use) easily and can customize `template`, `script` and `style` based on your needs.
3838

39-
features:
39+
## Features
4040

41-
- Support Vue 3 and Vue 2
41+
- Support `Vue 3` and `Vue 2`
4242
- Tailwind CSS friendly
4343
- Renderless component
4444
- SSR support
@@ -50,216 +50,44 @@ features:
5050
- Tiny bundle size
5151
- Accessibility support
5252

53-
## Installation
54-
55-
**Vue 3.0**
56-
57-
version `1.x`, `3.x` is for Vue 3.x.
58-
59-
NPM:
60-
61-
```bash
62-
npm install vue-final-modal@next --save
63-
```
64-
65-
Yarn:
66-
67-
```bash
68-
yarn add vue-final-modal@next
69-
```
70-
71-
**Vue 2.0**
72-
73-
version `0.x`, `2.x` is for Vue 2.x.
74-
75-
NPM:
53+
## **Development**
7654

7755
```bash
78-
npm install vue-final-modal@latest --save
79-
```
80-
81-
Yarn:
82-
83-
```bash
84-
yarn add vue-final-modal@latest
85-
```
56+
# Clone repo
57+
git clone https://github.com/vue-final/vue-final-modal.git
8658

87-
## Registeration
59+
# Run linter
60+
yarn lint
8861

89-
### Vue
62+
# Run unit test
63+
yarn test
9064

91-
```js
92-
import VueFinalModal from 'vue-final-modal'
65+
# Build library
66+
yarn
67+
yarn build
9368

94-
Vue.use(VueFinalModal())
95-
```
96-
97-
### Nuxt
98-
99-
- **Write a plugin `vue-final-modal.js`**
100-
101-
```js
102-
// plugins/vue-final-modal.js
103-
import VueFinalModal from 'vue-final-modal/lib'
104-
105-
Vue.use(VueFinalModal())
106-
```
107-
108-
- **Add plugin into `nuxt.config.js`**
109-
110-
```js
111-
// nuxt.config.js
112-
export default {
113-
plugins: [{ src: '~plugins/vue-final-modal.js' }],
114-
build: {
115-
transpile: ['vue-final-modal']
116-
}
117-
}
118-
```
69+
# Run examples
70+
cd examples
71+
yarn
72+
yarn serve
11973

120-
### CDN
121-
122-
> [Live demo](https://codepen.io/hunterliu1003/pen/ZEWoYeE)
123-
124-
- **jsDelivr**
125-
126-
```html
127-
<script src="https://cdn.jsdelivr.net/npm/vue-final-modal"></script>
74+
# Run docs
75+
cd docs
76+
yarn
77+
yarn dev
12878
```
12979

130-
- **Unpkg**
131-
132-
```html
133-
<script src="https://unpkg.com/vue-final-modal"></script>
134-
```
135-
136-
## Basic usage
137-
138-
### **Click button to open modal**
139-
140-
```html
141-
<vue-final-modal v-model="showModal">
142-
Modal Content Here
143-
</vue-final-modal>
144-
145-
<button @click="showModal = true">Launch</button>
146-
```
147-
148-
### **Open modal with API**
149-
150-
> `v-model` is necessary when you open a modal with `$vfm.show(name)` API.
151-
152-
```html
153-
<vue-final-modal v-model="showModal" name="example">
154-
Modal Content Here
155-
</vue-final-modal>
156-
```
157-
158-
```js
159-
this.$vfm.show('example')
160-
```
161-
162-
## **Configuration**
163-
164-
> Only work in v0.18+
165-
166-
Configuration options can be passed as a second argument to `Vue.use`.
167-
168-
```js
169-
import VueFinalModal from 'vue-final-modal'
170-
171-
Vue.use(VueFinalModal(), { ... })
172-
```
173-
174-
- `componentName`
175-
- `key`
176-
- `dynamicContainerName`
177-
178-
## **API**
179-
180-
- In Options API:
181-
182-
Plugin API can be called within any component through `this.$vfm`.
183-
184-
- In Composition API (Vue 3 only):
185-
186-
```js
187-
import { inject } from 'vue'
188-
189-
export default {
190-
setup() {
191-
const $vfm = inject('$vfm')
192-
}
193-
}
194-
```
195-
196-
- `$vfm.show(name, params)`
197-
- `$vfm.hide([names])`
198-
- `$vfm.hideAll()`
199-
- `$vfm.toggle(name, show, params)`
200-
- `$vfm.get([names])`
201-
- `$vfm.dynamicModals`
202-
- `$vfm.openedModals`
203-
- `$vfm.modals`
204-
205-
## **Props**
206-
207-
- `value`
208-
- `name`
209-
- `ssr`
210-
- `classes`
211-
- `overlayClass`
212-
- `contentClass`
213-
- `styles`
214-
- `overlayStyle`
215-
- `contentStyle`
216-
- `lockScroll`
217-
- `hideOverlay`
218-
- `clickToClose`
219-
- `escToClose`
220-
- `preventClick`
221-
- `attach`
222-
- `transition`
223-
- `overlayTransition`
224-
- `zIndexAuto`
225-
- `zIndexBase`
226-
- `zIndex`
227-
- `focusRetain`
228-
- `focusTrap`
229-
230-
## **Events**
231-
232-
- `@click-outside`
233-
- `@before-open`
234-
- `@opened`
235-
- `@before-close`
236-
- `@closed`
237-
238-
## **Slots**
239-
240-
If you open a modal though API `show(name, params)`, You can use scoped-slot to get `params` in template:
241-
242-
```html
243-
<template v-slot="{ params }">
244-
<!-- modal content -->
245-
</template>
246-
```
247-
248-
Or get `params` on `@beforeOpen` event:
249-
250-
```html
251-
<vue-final-modal @beforeOpen="e => e.ref.params">
252-
<!-- modal content -->
253-
</vue-final-modal>
254-
```
80+
## **Contribution**
25581

256-
> `parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.
82+
Thank you to all the people who already contributed to `vue-final-modal`!
25783

258-
## **Contribution**
84+
<a href="https://github.com/vue-final/vue-final-modal/graphs/contributors">
85+
<img src="https://contrib.rocks/image?repo=vue-final/vue-final-modal" />
86+
</a>
25987

260-
👋 Hi I'm Hunter, the author of `vue-final-modal`.
88+
Made with [contributors-img](https://contrib.rocks).
26189

262-
To develop vue-final-modal, I learn a lot from these awesome libraries:
90+
To develop `vue-final-modal`, I learn a lot from these awesome libraries:
26391

26492
- [Vuetify](https://vuetifyjs.com/en/)
26593
- attach
@@ -276,4 +104,4 @@ To develop vue-final-modal, I learn a lot from these awesome libraries:
276104

277105
> There is no perfect library even the `final` of vue modal.
278106
279-
If you have any ideas for optimization of `vue-final-modal`, feel free to open [issues](https://github.com/hunterliu1003/vue-final-modal/issues) or [pull requests](https://github.com/hunterliu1003/vue-final-modal/pulls).
107+
🚀 If you have any ideas for optimization of `vue-final-modal`, feel free to open [issues](https://github.com/hunterliu1003/vue-final-modal/issues) or [pull requests](https://github.com/hunterliu1003/vue-final-modal/pulls).

docs/content/en/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ yarn dev
7676

7777
## **Contribution**
7878

79-
👋 Hi I'm Hunter, the author of `vue-final-modal`.
79+
Thank you to all the people who already contributed to `vue-final-modal`!
80+
81+
<a href="https://github.com/vue-final/vue-final-modal/graphs/contributors">
82+
<img src="https://contrib.rocks/image?repo=vue-final/vue-final-modal" />
83+
</a>
84+
85+
Made with [contributors-img](https://contrib.rocks).
8086

8187
To develop `vue-final-modal`, I learn a lot from these awesome libraries:
8288

0 commit comments

Comments
 (0)