Commit 98252a9e15cbbeb64ab5ba4d0b7c14dd37f81aee

Authored by Xotic750
1 parent 5a3fe3ec

Checkbox WIP

src/components/checkbox/checkbox.vue
1 1 <template>
2   - <label :class="wrapClasses">
  2 + <label
  3 + :class="wrapClasses"
  4 + @keydown.space.prevent="$el.click()"
  5 + tabindex="0">
3 6 <span :class="checkboxClasses">
4 7 <span :class="innerClasses"></span>
5 8 <input
6 9 v-if="group"
7 10 type="checkbox"
  11 + tabindex="-1"
8 12 :class="inputClasses"
9 13 :disabled="disabled"
10 14 :value="label"
... ... @@ -14,6 +18,7 @@
14 18 <input
15 19 v-if="!group"
16 20 type="checkbox"
  21 + tabindex="-1"
17 22 :class="inputClasses"
18 23 :disabled="disabled"
19 24 :checked="currentValue"
... ... @@ -115,6 +120,7 @@
115 120 },
116 121 methods: {
117 122 change (event) {
  123 + console.log(event);
118 124 if (this.disabled) {
119 125 return false;
120 126 }
... ...
src/styles/mixins/checkbox.less
... ... @@ -236,6 +236,14 @@
236 236 font-size: @font-size-small;
237 237 display: inline-block;
238 238 margin-right: 8px;
  239 + outline: 0;
  240 + &:focus,
  241 + &:active {
  242 + & .@{checkbox-prefix-cls}-inner {
  243 + box-shadow: 0 0 0 2px fade(@primary-color, 20%);
  244 + }
  245 + }
  246 +
239 247 &-disabled{
240 248 cursor: @cursor-disabled;
241 249 }
... ...