<template>
<div>
<div class="box">
<mc-btn type="primary" @click="dislogChange">dialog弹框</mc-btn>
</div>
<mc-dialog
title="这是一个弹窗"
:visible="showDialog"
width="60%"
@close="showDialog = false"
>
<template v-slot:title>
<h3>这是一个标题</h3>
</template>
<div>这是内容部分</div>
<template v-slot:footer>
<mc-btn @click="showDialog = false" plain type="none"
>取消</mc-btn
>
<mc-btn plain type="primary" @click="showDialog = false" >确认</mc-btn>
</template>
</mc-dialog>
</div>
</template>
<script>
export default {
data() {
return {
showDialog: false
}
},
methods: {
dislogChange() {
this.showDialog = true;
}
}
}
</script>
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