1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
| <template>
| <teleport to="body">
| <div @click="$emit('close')"></div>
| <dialog open>
| <header>
| <slot name="header">
| <h2>{{ title }}</h2>
| </slot>
| </header>
| <section>
| <slot></slot>
| </section>
| <menu>
| <slot name="action">
| <base-button @click="$emit('close')"></base-button>
| </slot>
| </menu>
| </dialog>
| </teleport>
| </template>
|
| <script>
| export default {
| // props: ['title'],
| props: {
| title: {
| type: String,
| required: false,
| },
| },
| emits: ['close'],
| };
| </script>
|
| <style scoped>
| div {
| position: fixed;
| top: 0;
| left: 0;
| height: 100vh;
| width: 100%;
| background-color: rgba(0, 0, 0, 0.75);
| z-index: 10;
| }
|
| dialog {
| position: fixed;
| top: 20vh;
| left: 10%;
| width: 80%;
| z-index: 100;
| border-radius: 12px;
| border: none;
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
| padding: 0;
| margin: 0;
| overflow: hidden;
| }
|
| header {
| background-color: #3a0061;
| color: white;
| width: 100%;
| padding: 1rem;
| }
|
| header h2 {
| margin: 0;
| }
|
| section {
| padding: 1rem;
| }
|
| menu {
| padding: 1rem;
| display: flex;
| justify-content: flex-end;
| margin: 0;
| }
|
| @media (min-width: 768px) {
| dialog {
| left: calc(50% - 20rem);
| width: 40rem;
| }
| }
| </style>
|
|