-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
103 lines (99 loc) · 3.94 KB
/
index.html
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
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html>
<head>
<title>Vuetify Toast Snackbar Demo</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons" rel="stylesheet" />
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui" />
</head>
<body>
<div id="app">
<v-app>
<v-content class="pa-4">
<h1>Vuetify Toast Snackbar Demo</h1>
<v-btn @click="success('Hello')" color="primary">Show 'hello'</v-btn>
<v-btn @click="custom('Hello from custom')">Show Custom</v-btn>
<v-btn @click="error('Error')" color="primary">Show 'error'</v-btn>
<v-btn @click="showToast('This is an information.', { timeout: 10000, icon: 'info', dismissable: false, showClose: true })" color="primary">Show toast for 10 sec</v-btn>
<v-btn @click="clearQueue" color="primary">Clear queue</v-btn>
<br />
<br />
<pre>
this.$toast.success('Hello', {
queueable: true
});
this.$toast.error('Error');
this.$toast('This is an information.', {
timeout: 10000,
icon: 'info',
dismissable: false,
showClose: true
});
</pre
>
<br />
<br />
Documentation: <a href="https://github.com/eolant/vuetify-toast-snackbar">https://github.com/eolant/vuetify-toast-snackbar</a>
</v-content>
</v-app>
</div>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vuetify/dist/vuetify.js"></script>
<!-- <script src="https://unpkg.com/vuetify-toast-snackbar-ng"></script> -->
<script src="/dist/index.umd.js"></script>
<script>
Vue.use(vuetifyToast, {
x: "right", // default
y: "bottom", // default
color: "info", // default
icon: "info",
iconColor: "", // default
classes: ["body-2"],
timeout: 3000, // default
dismissable: true, // default
multiLine: false, // default
vertical: false, // default
queueable: false, // default
showClose: false, // default
closeText: "", // default
closeIcon: "close", // default
closeColor: "", // default
slot: [], //default
shorts: {
custom: {
color: "purple",
},
},
property: "$toast", // default
});
new Vue({
el: "#app",
vuetify: new Vuetify(),
created() {},
mounted() {},
methods: {
success: function(text) {
this.$toast.success(text, {
queueable: true,
});
},
custom: function(text) {
this.$toast.custom(text, {
queueable: true,
color: "red",
});
},
error: function(text) {
this.$toast.error(text);
},
showToast: function(text, opt) {
this.$toast(text, opt);
},
clearQueue: function() {
this.$toast.clearQueue();
},
},
});
</script>
</body>
</html>