modal.vue
1.32 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
<template>
<div>
<Button type="primary" @click="modal1 = true">Display dialog box</Button>
<Button type="primary" @click="modal2 = true">Display dialog box</Button>
<Button @click="hc">Click Me</Button>
<Modal
v-model="modal1"
title="Common Modal dialog box title"
dragable
@on-ok="ok"
@on-cancel="cancel">
<p>Content of dialog</p>
<p>Content of dialog</p>
<p>Content of dialog</p>
</Modal>
<Modal
v-model="modal2"
title="Common Modal dialog box title2"
dragable
@on-ok="ok"
@on-cancel="cancel">
<p>Content of dialog</p>
<p>Content of dialog</p>
<p>Content of dialog</p>
</Modal>
</div>
</template>
<script>
export default {
data () {
return {
modal1: false,
modal2: false
}
},
methods: {
ok () {
this.$Message.info('Clicked ok');
},
cancel () {
this.$Message.info('Clicked cancel');
},
hc () {
this.$Message.info('Hello');
}
}
}
</script>