-
Notifications
You must be signed in to change notification settings - Fork 0
/
Center.vue
62 lines (57 loc) · 1.23 KB
/
Center.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
<script lang="ts" setup>
const props = defineProps<{
modelValue: boolean;
outerClass?: string;
headerClass?: string;
}>();
const emit = defineEmits<{
(event: "update:modelValue", value: boolean): void;
(event: "hide"): void;
}>();
const visible = computed({
get() {
return props.modelValue;
},
set(value) {
emit("update:modelValue", value);
},
});
</script>
<template>
<PvDialog
modal
v-model:visible="visible"
unstyled
:pt="{
root: {
class: [
'bg-bg-primary dark:bg-bg-secondary rounded-lg shadow-xl border',
outerClass,
],
},
header: {
class: ['p-4 flex justify-between items-center border-b', headerClass],
},
headerTitle: {
class: 'font-semibold',
},
content: {
class: 'p-2 max-h-[80vh] overflow-y-auto',
},
footer: {
class: 'p-2 border-t flex justify-end items-center',
},
}"
@hide="() => emit('hide')"
>
<slot></slot>
<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
<slot :name="name" v-bind="slotData"></slot>
</template>
</PvDialog>
</template>
<style>
[data-pc-section="mask"] {
background-color: rgba(0, 0, 0, 0.5);
}
</style>