Focus on <label> when <input> gets the focus
This commit is contained in:
parent
98252a9e15
commit
ea49834da9
1 changed files with 8 additions and 5 deletions
|
@ -8,22 +8,26 @@
|
||||||
<input
|
<input
|
||||||
v-if="group"
|
v-if="group"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
:class="inputClasses"
|
:class="inputClasses"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:value="label"
|
:value="label"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
:name="name"
|
:name="name"
|
||||||
@change="change">
|
@change="change"
|
||||||
|
@focus="$el.focus()"
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
v-if="!group"
|
v-if="!group"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
:class="inputClasses"
|
:class="inputClasses"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:checked="currentValue"
|
:checked="currentValue"
|
||||||
:name="name"
|
:name="name"
|
||||||
@change="change">
|
@change="change"
|
||||||
|
@focus="$el.focus()"
|
||||||
|
>
|
||||||
</span>
|
</span>
|
||||||
<slot><span v-if="showSlot">{{ label }}</span></slot>
|
<slot><span v-if="showSlot">{{ label }}</span></slot>
|
||||||
</label>
|
</label>
|
||||||
|
@ -120,7 +124,6 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
change (event) {
|
change (event) {
|
||||||
console.log(event);
|
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue