File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ const clickDialog = () => {
2121 dialog .value .title = ' This is a dialog!'
2222 dialog .value .message = ' It can have fun messages.'
2323 dialog .value .action .function = () => {
24- dialog .value .show = false
24+ dialog .value .action .loading = true
25+ setTimeout (() => {
26+ dialog .value .action .loading = false
27+ dialog .value .show = false
28+ }, 2000 )
2529 }
2630 dialog .value .show = true
2731}
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ const dialog = useDialog()
2929
3030 <v-btn
3131 :color =" dialog.action.buttonColor || 'secondary'"
32+ :loading =" dialog.action.loading"
33+ :disabled =" dialog.action.loading"
3234 variant =" flat"
3335 @click =" dialog.action.function"
3436 >
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export interface Dialog {
99 function : ( ( ) => Promise < void > ) | ( ( ) => void ) | null
1010 buttonText : string
1111 buttonColor : string
12+ loading : boolean
1213 }
1314 closeButtonText : string
1415}
@@ -21,6 +22,7 @@ export const dialogInitialState: Dialog = {
2122 function : null ,
2223 buttonText : 'Confirm' ,
2324 buttonColor : '' ,
25+ loading : false ,
2426 } ,
2527 closeButtonText : 'Cancel' ,
2628}
You can’t perform that action at this time.
0 commit comments