Skip to content

Commit 24b7dcd

Browse files
committed
update docs
1 parent 3f4ef33 commit 24b7dcd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1134
-404
lines changed

docs/components/global/BaseButton.vue

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
aria-hidden="true"
5+
x="0px"
6+
y="0px"
7+
viewBox="0 0 100 100"
8+
width="16"
9+
height="16"
10+
>
11+
<path
12+
fill="currentColor"
13+
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"
14+
/>
15+
<polygon
16+
fill="currentColor"
17+
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"
18+
/>
19+
</svg>
20+
</template>

docs/components/global/OuterLink.vue

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<a :href="url" class="codepen-link" target="_blank" rel="noopener noreferrer">
3+
SEE PEN
4+
<OutboundLink></OutboundLink>
5+
</a>
6+
</template>
7+
8+
<script>
9+
export default {
10+
props: {
11+
url: {
12+
type: String,
13+
required: true
14+
}
15+
}
16+
}
17+
</script>
18+
19+
<style scoped>
20+
.codepen-link {
21+
@apply text-gray-600 text-sm font-medium inline-flex items-center;
22+
}
23+
.codepen-link:hover {
24+
@apply underline;
25+
}
26+
.codepen-link::before {
27+
content: unset;
28+
}
29+
.dark-mode .codepen-link {
30+
@apply text-gray-400;
31+
}
32+
</style>

docs/components/global/ShowCode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<details>
2+
<details class="pt-4">
33
<summary class="outline-none">Show code</summary>
44
<slot />
55
</details>

docs/content/en/events.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,31 @@ position: 3
55
category: Getting Start
66
---
77

8-
## `@before-open`
8+
## All events
9+
10+
### `@before-open`
911

1012
Emits while modal is still invisible, but before transition starting.
1113

12-
## `@opened`
14+
### `@opened`
1315

1416
Emits after modal became visible and transition ended.
1517

16-
## `@before-close`
18+
### `@before-close`
1719

1820
Emits before modal is going to be closed.
1921

20-
## `@closed`
22+
### `@closed`
2123

2224
Emits right before modal is destroyed.
2325

2426
## Examples
2527

2628
<tailwind-events></tailwind-events>
2729

28-
```html[SFC]
30+
<show-code open>
31+
32+
```html
2933
<template>
3034
<vue-final-modal
3135
@before-open="beforeOpen"
@@ -36,4 +40,6 @@ Emits right before modal is destroyed.
3640
...modal content
3741
</vue-final-modal>
3842
</template>
39-
```
43+
```
44+
45+
</show-code>
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
title: Step by step
3+
description: 'Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.'
4+
position: 2
5+
category: Examples
6+
fullscreen: true
7+
---
8+
9+
<alert>
10+
11+
[Checkout the example source code](https://github.com/hunterliu1003/vue-final-modal/tree/master/example/src/components/basic)
12+
13+
</alert>
14+
15+
16+
17+
## Style the modal component step by step
18+
19+
**1. Hello, `vue-final-modal` !**
20+
21+
<v-basic class="mb-4"></v-basic>
22+
23+
<codepen path="basic/VBasic"></codepen>
24+
25+
<show-code>
26+
27+
```vue
28+
<template>
29+
<div>
30+
<vue-final-modal v-model="showModal">
31+
<span class="modal__title">Hello, vue-final-modal !</span>
32+
</vue-final-modal>
33+
<button class="vfm-btn" @click="showModal = true">Open modal</button>
34+
</div>
35+
</template>
36+
37+
<script>
38+
export default {
39+
data: () => ({
40+
showModal: false
41+
})
42+
}
43+
</script>
44+
45+
<style scoped>
46+
.modal__title {
47+
font-size: 1.5rem;
48+
font-weight: 700;
49+
}
50+
</style>
51+
```
52+
53+
</show-code>
54+
55+
**2. Add `background-color`, `border-radius`**
56+
57+
<v-background class="mb-4"></v-background>
58+
59+
<!-- <codepen path="basic/VBackground"></codepen> -->
60+
61+
**3. Center the modal with prop `classes`**
62+
63+
<v-centered class="mb-4"></v-centered>
64+
65+
<!-- <codepen path="basic/VCentered"></codepen> -->
66+
67+
**4. Add `content` for the modal**
68+
69+
<v-content class="mb-4"></v-content>
70+
71+
<!-- <codepen path="basic/VContent"></codepen> -->
72+
73+
**5. Add button to close the modal**
74+
75+
<v-close-button class="mb-4"></v-close-button>
76+
77+
<!-- <codepen path="basic/VCloseButton"></codepen> -->
78+
79+
**6. Make the modal `scrollable` and limit the `max-height` for mobile**
80+
81+
<v-scrollable class="mb-4"></v-scrollable>
82+
83+
<!-- <codepen path="basic/VScrollable"></codepen> -->
84+
85+
**7. Add `confirm` and `cancel` buttons**
86+
87+
<v-action-buttons class="mb-4"></v-action-buttons>
88+
89+
<!-- <codepen path="basic/VActionButtons"></codepen> -->
90+
91+
**8. Make the modal stackable**
92+
93+
<v-stackable class="mb-4"></v-stackable>
94+
95+
<!-- <codepen path="basic/VStackable"></codepen> -->
96+
97+
### Optional steps
98+
99+
**Prop: `hideOverlay`**
100+
101+
<!-- <tailwind-hide-overlay></tailwind-hide-overlay> -->
102+
103+
**Prop: `lockScroll`**
104+
105+
<!-- <tailwind-lock-scroll></tailwind-lock-scroll> -->
106+
107+
**Prop: `clickToClose`**
108+
109+
<!-- <tailwind-click-to-close></tailwind-click-to-close> -->
110+
111+
**Prop: `preventClick`**
112+
113+
<!-- <tailwind-prevent-click></tailwind-prevent-click> -->
114+
115+
**Prop: `attach`**
116+
117+
<!-- <tailwind-attach></tailwind-attach> -->

docs/content/en/examples/tailwind-codepen.md

Lines changed: 0 additions & 55 deletions
This file was deleted.

docs/content/en/examples/tailwind.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: TailwindCSS
33
description: 'Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.'
4-
position: 2
4+
position: 3
55
category: Examples
66
fullscreen: true
77
---
@@ -10,7 +10,7 @@ See [Tailwind Examples Source Code](https://github.com/hunterliu1003/vue-final-m
1010

1111
## Simple
1212

13-
<tailwind-simple></tailwind-simple>
13+
<tailwind-basic></tailwind-basic>
1414

1515
<show-code>
1616

docs/content/en/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If you need a highly customizable modal component for Vue.js, `Vue Final Modal`
4545

4646
## Installation
4747

48-
### Vue 3.0
48+
**Vue 3.0**
4949

5050
<code-group>
5151
<code-block label="Yarn" active>
@@ -64,7 +64,7 @@ npm install vue-final-modal@next
6464
</code-block>
6565
</code-group>
6666

67-
### Vue 2.0
67+
**Vue 2.0**
6868

6969
<code-group>
7070
<code-block label="Yarn" active>
@@ -85,7 +85,7 @@ npm install vue-final-modal
8585

8686
## Basic usage
8787

88-
### Register component
88+
**1. Register component**
8989

9090
```js
9191
import { VueFinalModal } from 'vue-final-modal'
@@ -97,21 +97,21 @@ export default {
9797
}
9898
```
9999

100-
### Add component
100+
**2. Add component to template**
101101

102102
```html
103103
<vue-final-modal v-model="showModal">
104104
Modal Content Here
105105
</vue-final-modal>
106106
```
107107

108-
### Create a button
108+
**3. Create a button**
109109

110110
```html
111111
<button @click="showModal = true">Launch</button>
112112
```
113113

114-
### All default props
114+
**4. All default props**
115115

116116
```js
117117
const CLASS_TYPES = [String, Object, Array]
@@ -134,18 +134,18 @@ const CLASS_TYPES = [String, Object, Array]
134134
}
135135
```
136136

137-
### Events
137+
**5. All events**
138138

139139
- @before-open: Before open
140140
- @opened: When opened
141141
- @before-close: Before close
142142
- @closed: After closed
143143

144-
## Basic Example
144+
## Basic example
145145

146146
<basic-options></basic-options>
147147

148-
## [See more examples](/examples)
148+
<alert>[Checkout the live examples](/examples)</alert>
149149

150150
## Contribution
151151

0 commit comments

Comments
 (0)