-
Notifications
You must be signed in to change notification settings - Fork 94
/
VActionButtons.vue
75 lines (72 loc) 路 1.6 KB
/
VActionButtons.vue
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
<template>
<div>
<v-modal v-model="showModal" classes="modal-container" content-class="modal-content">
<button class="modal__close" @click="showModal = false">
<mdi-close></mdi-close>
</button>
<span class="modal__title">Hello, vue-final-modal</span>
<div class="modal__content">
<p v-for="i in 100" :key="i">
Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.
</p>
</div>
<div class="modal__action">
<v-button @click="showModal = false">confirm</v-button>
<v-button @click="showModal = false">cancel</v-button>
</div>
</v-modal>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>
<script>
export default {
data: () => ({
showModal: false
})
}
</script>
<style scoped>
::v-deep .modal-container {
display: flex;
justify-content: center;
align-items: center;
}
::v-deep .modal-content {
position: relative;
display: flex;
flex-direction: column;
max-height: 90%;
margin: 0 1rem;
padding: 1rem;
border: 1px solid #e2e8f0;
border-radius: 0.25rem;
background: #fff;
}
.modal__title {
margin: 0 2rem 0 0;
font-size: 1.5rem;
font-weight: 700;
}
.modal__content {
flex-grow: 1;
overflow-y: auto;
}
.modal__action {
display: flex;
justify-content: center;
align-items: center;
flex-shrink: 0;
padding: 1rem 0 0;
}
.modal__close {
position: absolute;
top: 0.5rem;
right: 0.5rem;
}
</style>
<style scoped>
.dark-mode div::v-deep .modal-content {
border-color: #2d3748;
background-color: #1a202c;
}
</style>