File tree 6 files changed +91
-5
lines changed
6 files changed +91
-5
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ export default defineClientConfig({
19
19
registerComponent ( 'FeaturesExampleConfirmHard' )
20
20
registerComponent ( 'FeaturesExamplePrompt' )
21
21
registerComponent ( 'FeaturesExampleDirective' )
22
+ registerComponent ( 'OptionsExampleAnimation' )
23
+ registerComponent ( 'OptionsExampleLoader' )
22
24
} ,
23
25
setup ( ) { } ,
24
26
rootComponents : [ ] ,
Original file line number Diff line number Diff line change 16
16
body: ' What is the most important thing in life?' ,
17
17
}, {
18
18
cancelText: ' Dismiss' ,
19
- okText: ' Yes ' ,
19
+ okText: ' Done ' ,
20
20
promptHelp: ' Type in the box below and click "[+:okText]"'
21
21
}).then (result => {
22
- console .log ({ result })
22
+ if (result .canceled ) return ;
23
+ $dialog .alert (JSON .stringify (result))
23
24
})
24
25
</script >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <UIExamplesButton @click =" openDialog('zoom')" >Zoom</UIExamplesButton >  ;
3
+ <UIExamplesButton @click =" openDialog('fade')" >Fade</UIExamplesButton >  ;
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 >
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change 1
1
# Digging deeper
2
2
3
3
## 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
+
6
40
7
41
## Custom component
42
+ // Todo
8
43
Original file line number Diff line number Diff line change 1
- # Features
1
+ # Basic Features
2
2
3
3
[[ toc]]
4
4
You can’t perform that action at this time.
0 commit comments