11<template >
22 <transition enter-active-class =" transition ease-out duration-300" enter-from-class =" opacity-0" enter-to-class =" opacity-100" leave-from-class =" opacity-100" leave-to-class =" opacity-0" >
3- <div v-show =" showing " class =" fixed inset-0 z-10 overflow-y-auto" >
3+ <div v-show =" $props.isShowing " class =" fixed inset-0 z-10 overflow-y-auto" >
44 <div class =" flex items-center justify-center min-h-screen pt-4 px-4 pb-20" >
55 <div class =" fixed inset-0 transition-opacity" aria-hidden =" true" >
66 <div class =" absolute inset-0 bg-gray-800 opacity-75" ></div >
77 </div >
88 <div class =" m-8 inline-block align-middle w-full max-w-2xl transform transition-all" >
9- <button v-if =" showClose" aria-label =" close" class =" absolute z-10 bg-white rounded-full py-2 px-2 -top-5 -right-5 cursor-pointer focus:outline-none" @click.prevent =" onClose" >
9+ <button v-if =" $props. showClose" aria-label =" close" class =" absolute z-10 bg-white rounded-full py-2 px-2 -top-5 -right-5 cursor-pointer focus:outline-none" @click.prevent =" onClose" >
1010 <svg class =" h-4 w-4 text-gray-600" xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
1111 <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M6 18L18 6M6 6l12 12" />
1212 </svg >
1313 </button >
1414 <div >
15- <slot ></slot >
15+ <template v-if =" $props .isLoading " >
16+ <div class =" pt-10 pb-6 text-center" >
17+ <Spinner />
18+ </div >
19+ </template >
20+ <slot v-else ></slot >
1621 </div >
1722 </div >
1823 </div >
@@ -25,16 +30,21 @@ import {defineComponent} from "vue";
2530import Panel from " @/views/components/Panel.vue" ;
2631import TextInput from " @/views/components/input/TextInput.vue" ;
2732import Button from " @/views/components/input/Button.vue" ;
33+ import Spinner from " @/views/components/icons/Spinner.vue" ;
2834
2935export default defineComponent ({
30- components: {Button, TextInput, Panel},
31- emits: [' update:showing ' , ' close' ],
36+ components: {Spinner, Button, TextInput, Panel},
37+ emits: [' update:isShowing ' , ' close' ],
3238 props: {
3339 type: {
3440 type: String ,
3541 default: ' simple' ,
3642 },
37- showing: {
43+ isShowing: {
44+ type: Boolean ,
45+ default: false
46+ },
47+ isLoading: {
3848 type: Boolean ,
3949 default: false
4050 },
@@ -49,6 +59,7 @@ export default defineComponent({
4959 }
5060 return {
5161 onClose,
62+
5263 }
5364 }
5465});
0 commit comments