forked from Egorvah/vudal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
93 lines (84 loc) · 2.54 KB
/
App.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
<div id="app">
<button @click.prevent="$modals.simpleModal.$show()">Simple Modal</button>
<button @click.prevent="$modals.modalWithChild.$show()">Modal with child</button>
<button @click.prevent="$modals.alert('Hello world!')">Modal alert</button>
<button @click.prevent="confirm()">Modal confirm</button>
<vudal name="simpleModal">
<div class="header">
<i class="close icon">×</i>
Title
</div>
<div class="content">
Content
</div>
<div class="actions">
<div class="cancel vudal-btn">Close</div>
</div>
</vudal>
<vudal name="modalWithChild">
<div class="header">
<i class="close icon">×</i>
Parent
</div>
<div class="content">
Lorem ipsum dolor sit amet, pro quodsi feugiat epicurei in, modo repudiandae at sed.
Pro persius contentiones et, no pro posse postulant, nec labore omittam an.
Mel amet idque scripserit cu, pro eu solum justo.
Aperiam cotidieque te duo, mel te denique offendit explicari.
Pri ex eius quaeque adipiscing, ut sonet legere vivendo eam.
Sint liber volumus ad qui, mea ex magna oportere philosophia, et corrumpit forensibus mel.
Id nec quod graeco percipitur, usu te error laboramus signiferumque.
Nec persius complectitur cu, ei est mutat fuisset placerat.
</div>
<div class="actions">
<div class="cancel vudal-btn">Close</div>
<div class="vudal-btn" @click.prevent="$modals.child.$show()">Show child modal</div>
</div>
</vudal>
<vudal name="child" parent="modalWithChild">
<div class="header">
<i class="close icon">×</i>
Child
</div>
<div class="content">
Per fastidii definiebas ea.
Est fabulas ponderum intellegam id.
Pri sale docendi eleifend ei.
</div>
<div class="actions">
<div class="cancel vudal-btn">Close</div>
</div>
</vudal>
</div>
</template>
<script>
import Vudal from './../src/index.js';
export default {
components: { Vudal },
methods: {
confirm() {
this.$modals.confirm({
message: 'Confirm?',
onApprove: () => { alert('Approve'); },
onCancel: () => { alert('Cancel'); },
});
},
},
};
</script>
<style>
.close {
float: right;
font-size: 21px;
font-weight: 700;
line-height: 1;
color: #bbb;
text-shadow: 0 1px 0 #fff;
filter: alpha(opacity=20);
cursor: pointer;
}
.close:hover {
color: #000;
}
</style>