11<template >
22 <section
3- :class =" {'dark': darkTheme, 'disabled': disabled}"
4- :title =" title"
5- class =" wrapper"
3+ :class =" {'dark': darkTheme, 'disabled': disabled}"
4+ :title =" title"
5+ class =" wrapper"
66 >
77 <input
88 :id =" `_${name}`"
99 v-model =" toggleState"
10+ :aria-checked =" toggleState"
11+ :aria-readonly =" !toggleState"
1012 :disabled =" disabled"
1113 :name =" name"
1214 class =" toggle"
15+ role =" checkbox"
1316 type =" checkbox"
1417 />
1518 <label
16- :for =" name"
17- :style =" [toggleState && {' background' : activeColor}]"
18- class =" toggler"
19- @click =" toggle"
19+ :for =" name"
20+ :style =" [toggleState && {background: activeColor}]"
21+ class =" toggler"
22+ @click =" toggle"
2023 />
21- <span class =" title" @click =" toggle" >{{title}}</span >
24+ <span
25+ class =" title"
26+ @click =" toggle"
27+ :style =" [{fontSize, fontWeight}]"
28+ >
29+ {{title}}
30+ </span >
2231 </section >
2332</template >
2433
@@ -28,11 +37,13 @@ export default {
2837
2938 props: {
3039 activeColor: {type: String , default: ' #9FD6AE' },
31- darkTheme: {type: Boolean , default: false },
32- disabled: {type: Boolean , default: false },
33- name: {type: String , required: true },
34- title: {type: String , required: true },
35- toggled: {type: Boolean , default: false },
40+ darkTheme: {type: Boolean , default: false },
41+ disabled: {type: Boolean , default: false },
42+ fontSize: {type: Number , default: 16 },
43+ fontWeight: {type: String , default: ' bold' },
44+ name: {type: String , required: true },
45+ title: {type: String , required: true },
46+ toggled: {type: Boolean , default: false },
3647 },
3748
3849 data () {
@@ -65,7 +76,6 @@ export default {
6576
6677.title {
6778 display : inline-block ;
68- font-weight : 700 ;
6979 line-height : 2em ;
7080 vertical-align : middle ;
7181
0 commit comments