Checkbox WIP

This commit is contained in:
Xotic750 2018-01-18 20:32:20 +01:00
parent 5a3fe3ec62
commit 98252a9e15
2 changed files with 15 additions and 1 deletions

View file

@ -1,10 +1,14 @@
<template> <template>
<label :class="wrapClasses"> <label
:class="wrapClasses"
@keydown.space.prevent="$el.click()"
tabindex="0">
<span :class="checkboxClasses"> <span :class="checkboxClasses">
<span :class="innerClasses"></span> <span :class="innerClasses"></span>
<input <input
v-if="group" v-if="group"
type="checkbox" type="checkbox"
tabindex="-1"
:class="inputClasses" :class="inputClasses"
:disabled="disabled" :disabled="disabled"
:value="label" :value="label"
@ -14,6 +18,7 @@
<input <input
v-if="!group" v-if="!group"
type="checkbox" type="checkbox"
tabindex="-1"
:class="inputClasses" :class="inputClasses"
:disabled="disabled" :disabled="disabled"
:checked="currentValue" :checked="currentValue"
@ -115,6 +120,7 @@
}, },
methods: { methods: {
change (event) { change (event) {
console.log(event);
if (this.disabled) { if (this.disabled) {
return false; return false;
} }

View file

@ -236,6 +236,14 @@
font-size: @font-size-small; font-size: @font-size-small;
display: inline-block; display: inline-block;
margin-right: 8px; margin-right: 8px;
outline: 0;
&:focus,
&:active {
& .@{checkbox-prefix-cls}-inner {
box-shadow: 0 0 0 2px fade(@primary-color, 20%);
}
}
&-disabled{ &-disabled{
cursor: @cursor-disabled; cursor: @cursor-disabled;
} }