forked from shakee93/vue-toasted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
using-icons.js
57 lines (46 loc) · 1.28 KB
/
using-icons.js
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
import Vue from 'vue';
import VueToasted from 'vue-toasted';
Vue.use(VueToasted, {
iconPack : 'material' // set your iconPack, defaults to material. material|fontawesome|custom-class
});
/* NOTE : You will have to import material icons in order to work */
// use icon name as a string
Vue.toasted.show('hello there, i am a toast !!', { icon : 'check'});
// you can pass an object and use name
Vue.toasted.show(
'hello there, i am a toast !!', {
icon : {
name : 'check'
}
});
// use after to append the icon after the content
Vue.toasted.show(
'hello there, i am a toast !!', {
icon : {
name : 'check',
after : true
}
});
// Custom Class Icon Pack
Vue.use(VueToasted, {
iconPack: 'custom-class' // set your iconPack, defaults to material. material|fontawesome|custom-class
});
// append any class to the toaster icon
Vue.toasted.show(
'hello there, i am a toast !!', {
icon: {
name: 'fal fa-check fa-spin fa-fw',
}
});
// Callback as icon pack
Vue.use(VueToasted, {
iconPack: 'callback'
});
Vue.toasted.show(
'hello there, i am a toast !!', {
// el is icon html element you can play with it
icon: (el) => {
el.innerText = 'my icon logic';
return el;
}
});