-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathUIDropdownModal.vue
75 lines (67 loc) · 1.34 KB
/
UIDropdownModal.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>
<form class="wrapper" @submit.prevent="emit('confirm')">
<header class="header">
<h4 class="title">{{ title }}</h4>
<UIModalClose class="close" @click="emit('cancel')" />
</header>
<UIDivider />
<main class="body">
<slot></slot>
</main>
<footer class="footer">
<UIButton type="boring" @click="emit('cancel')">
{{ $t({ en: 'Cancel', zh: '取消' }) }}
</UIButton>
<UIButton type="primary" html-type="submit">
{{ $t({ en: 'Confirm', zh: '确认' }) }}
</UIButton>
</footer>
</form>
</template>
<script setup lang="ts">
import { UIButton, UIDivider } from '@/components/ui'
import UIModalClose from './UIModalClose.vue'
defineProps<{
title: string
}>()
const emit = defineEmits<{
cancel: []
confirm: []
}>()
</script>
<style scoped lang="scss">
.wrapper {
display: flex;
flex-direction: column;
align-items: stretch;
}
.header {
flex: 0 0 auto;
display: flex;
align-items: center;
padding: 0 16px;
height: 44px;
}
.title {
font-size: 16px;
line-height: 26px;
flex: 1;
color: var(--ui-color-title);
}
.close {
margin-right: -4px;
}
.body {
padding: 12px 16px;
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
}
.footer {
flex: 0 0 auto;
padding: 16px;
display: flex;
gap: 12px;
justify-content: flex-end;
}
</style>