File tree Expand file tree Collapse file tree 4 files changed +37
-5
lines changed Expand file tree Collapse file tree 4 files changed +37
-5
lines changed Original file line number Diff line number Diff line change 2020 "vue-loader" : " ^11.1.4" ,
2121 "vue-template-compiler" : " ^2.2.1" ,
2222 "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"
2427 }
2528}
Original file line number Diff line number Diff line change 4747 :color =" {checked: '#7DCE94', unchecked: '#82C7EB'}"
4848 :width =" 80"
4949 :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+
5066 </div >
5167 <div style =" padding-top : 20px ;" >
5268 <toggle-button
Original file line number Diff line number Diff line change 11import Vue from 'vue'
22import App from './App.vue'
33import 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 )
410
511Vue . use ( ToggleButton )
612
Original file line number Diff line number Diff line change 1313 <template v-if =" labels " >
1414 <span class =" v-switch-label v-left"
1515 :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+
1822 <span class =" v-switch-label v-right"
1923 :style =" labelStyle"
20- v-else
21- v-html =" labelUnchecked" />
24+ v-else >
25+ <slot name =" unchecked" >
26+ <template >{{labelUnchecked}}</template >
27+ </slot >
28+ </span >
2229 </template >
2330</label >
2431</template >
You can’t perform that action at this time.
0 commit comments