File tree 4 files changed +37
-5
lines changed
4 files changed +37
-5
lines changed Original file line number Diff line number Diff line change 20
20
"vue-loader" : " ^11.1.4" ,
21
21
"vue-template-compiler" : " ^2.2.1" ,
22
22
"webpack" : " ^2.2.0" ,
23
- "webpack-dev-server" : " ^2.2.0"
23
+ "webpack-dev-server" : " ^2.2.0" ,
24
+ "@fortawesome/fontawesome-svg-core" : " ^1.2.8" ,
25
+ "@fortawesome/free-solid-svg-icons" : " ^5.5.0" ,
26
+ "@fortawesome/vue-fontawesome" : " ^0.1.2"
24
27
}
25
28
}
Original file line number Diff line number Diff line change 47
47
:color =" {checked: '#7DCE94', unchecked: '#82C7EB'}"
48
48
:width =" 80"
49
49
:switchColor =" {checked: 'linear-gradient(red, yellow)', unchecked: '#F2C00B'}" />
50
+
51
+ <toggle-button :labels =" true" >
52
+ <template slot="checked">
53
+ <fa icon =' check' ></fa >
54
+ </template >
55
+ <template slot="unchecked">
56
+ <fa icon =' times' ></fa >
57
+ </template >
58
+ </toggle-button >
59
+
60
+ <toggle-button :width =" 120" :labels =" {checked: '', unchecked: 'FA Icon Support'}" >
61
+ <template slot="checked">
62
+ <fa icon =' check' ></fa >
63
+ </template >
64
+ </toggle-button >
65
+
50
66
</div >
51
67
<div style =" padding-top : 20px ;" >
52
68
<toggle-button
Original file line number Diff line number Diff line change 1
1
import Vue from 'vue'
2
2
import App from './App.vue'
3
3
import ToggleButton from 'plugin'
4
+ import { library } from '@fortawesome/fontawesome-svg-core'
5
+ import { faCheck , faTimes } from '@fortawesome/free-solid-svg-icons'
6
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
7
+
8
+ library . add ( [ faCheck , faTimes ] )
9
+ Vue . component ( 'fa' , FontAwesomeIcon )
4
10
5
11
Vue . use ( ToggleButton )
6
12
Original file line number Diff line number Diff line change 13
13
<template v-if =" labels " >
14
14
<span class =" v-switch-label v-left"
15
15
:style =" labelStyle"
16
- v-if =" toggled"
17
- v-html =" labelChecked" />
16
+ v-if =" toggled" >
17
+ <slot name =" checked" >
18
+ <template >{{labelChecked}}</template >
19
+ </slot >
20
+ </span >
21
+
18
22
<span class =" v-switch-label v-right"
19
23
:style =" labelStyle"
20
- v-else
21
- v-html =" labelUnchecked" />
24
+ v-else >
25
+ <slot name =" unchecked" >
26
+ <template >{{labelUnchecked}}</template >
27
+ </slot >
28
+ </span >
22
29
</template >
23
30
</label >
24
31
</template >
You can’t perform that action at this time.
0 commit comments