messageBox.vue
1.93 KB
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
<template>
<div class="message-box">
<el-dialog
v-model="dialogVisible"
:lock-scroll="false"
custom-class="dialog"
:show-close="false"
:close-on-click-modal="false"
:append-to-body="false"
>
<slot name="img"></slot>
<div class="generate-box">
<slot name="title"></slot>
<slot name="title1"></slot>
<slot name="content"></slot>
</div>
<img @click="props.onClose" class="close" src="@/views/assets/images/common/close.png" alt="" />
</el-dialog>
</div>
</template>
<script setup>
import { defineProps, watch, ref } from 'vue';
const dialogVisible = ref(false);
const props = defineProps({
isVisible: {
type: Boolean,
default: false
},
onClose: {
type: Function
}
});
watch(
() => props.isVisible,
() => {
dialogVisible.value = props.isVisible;
}
);
</script>
<style lang="less">
.message-box {
.dialog {
max-width: 284px;
min-width: 284px;
height: 197px;
margin-top: calc(50vh - 128.5px) !important;
border-radius: 10px;
.generate-box {
padding: 2px 12px 40px 12px !important;
text-align: center;
font-weight: 500;
color: #313033;
font-size: 18px;
div {
padding: 8px 0;
width: 220px;
line-height: 21px;
word-break: normal;
font-size: 14px;
span {
color: #606266;
font-size: 14px;
}
}
}
.close {
width: 24px;
height: 24px;
position: absolute;
bottom: -54px;
left: 50%;
margin-left: -12px;
cursor: pointer;
}
}
}
</style>