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