Skip to content

Commit cee93db

Browse files
committed
Chore(docs): update options section
1 parent b29a3ae commit cee93db

File tree

6 files changed

+91
-5
lines changed

6 files changed

+91
-5
lines changed

Diff for: docs/.vuepress/client.js

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export default defineClientConfig({
1919
registerComponent('FeaturesExampleConfirmHard')
2020
registerComponent('FeaturesExamplePrompt')
2121
registerComponent('FeaturesExampleDirective')
22+
registerComponent('OptionsExampleAnimation')
23+
registerComponent('OptionsExampleLoader')
2224
},
2325
setup() {},
2426
rootComponents: [],

Diff for: docs/components/examples/FeaturesExamplePrompt.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
body: 'What is the most important thing in life?',
1717
}, {
1818
cancelText: 'Dismiss',
19-
okText: 'Yes',
19+
okText: 'Done',
2020
promptHelp: 'Type in the box below and click "[+:okText]"'
2121
}).then(result => {
22-
console.log({ result })
22+
if (result.canceled) return;
23+
$dialog.alert(JSON.stringify(result))
2324
})
2425
</script>

Diff for: docs/components/examples/OptionsExampleAnimation.vue

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<template>
2+
<UIExamplesButton @click="openDialog('zoom')">Zoom</UIExamplesButton>&nbsp;
3+
<UIExamplesButton @click="openDialog('fade')">Fade</UIExamplesButton>&nbsp;
4+
<UIExamplesButton @click="openDialog('bounce')">Bounce</UIExamplesButton>
5+
</template>
6+
7+
<script setup>
8+
import {inject} from 'vue'
9+
import {injectionKey} from "../../../src/plugin/index.ts";
10+
11+
defineOptions({
12+
name: "OptionsExampleAnimation"
13+
})
14+
15+
const $dialog = inject(injectionKey)
16+
const openDialog = (animation) => $dialog.alert({
17+
title: 'Alert example',
18+
body: 'Session expired. Please login again to continue.',
19+
}, {
20+
okText: 'Dismiss',
21+
animation,
22+
backdropClose: true,
23+
})
24+
</script>

Diff for: docs/components/examples/OptionsExampleLoader.vue

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<template>
2+
<UIExamplesButton @click="openDialog()">Show dialog</UIExamplesButton>
3+
</template>
4+
5+
<script setup>
6+
import {inject} from 'vue'
7+
import {injectionKey} from "../../../src/plugin/index.ts";
8+
9+
defineOptions({
10+
name: "OptionsExampleLoader"
11+
})
12+
13+
const $dialog = inject(injectionKey)
14+
const openDialog = () => $dialog.confirm({
15+
title: 'Confirmation!',
16+
body: 'Delete is permanent. Do you wish to proceed?',
17+
}, {
18+
okText: 'Delete',
19+
loader: true,
20+
}).then(({ canceled, close }) => {
21+
if (canceled) return
22+
setTimeout(close, 2000)
23+
})
24+
</script>

Diff for: docs/digging-deeper.md

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
11
# Digging deeper
22

33
## Options
4-
### Custom Class
5-
### loader
4+
5+
```typescript
6+
declare interface DialogOptions {
7+
message: MessageWithTitle;
8+
html: boolean;
9+
loader: boolean;
10+
reverse: boolean;
11+
backdropClose: boolean;
12+
okText: string;
13+
cancelText: string;
14+
type: ConfirmTypeEnum;
15+
clicksCount: number;
16+
animation: 'zoom' | 'bounce' | 'fade';
17+
customClass: {
18+
[k: string]: string;
19+
};
20+
verification: string;
21+
verificationHelp: string;
22+
promptHelp: string;
23+
}
24+
```
25+
26+
### Animation
27+
There are three options to choose from so you have some flexibility with how the dialog transitions into view.
28+
29+
<UIExamplesWrapper><OptionsExampleAnimation /></UIExamplesWrapper>
30+
@[code](components/examples/OptionsExampleAnimation.vue)
31+
32+
33+
### Loader
34+
You may use the loader option to indicate that an asynchronous task is being performed after the user decides to proceed.
35+
<UIExamplesWrapper><OptionsExampleLoader /></UIExamplesWrapper>
36+
@[code](components/examples/OptionsExampleLoader.vue)
37+
38+
39+
640

741
## Custom component
42+
// Todo
843

Diff for: docs/features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Features
1+
# Basic Features
22

33
[[toc]]
44

0 commit comments

Comments
 (0)