File tree Expand file tree Collapse file tree 2 files changed +21
-44
lines changed
src/components/primitives Expand file tree Collapse file tree 2 files changed +21
-44
lines changed Original file line number Diff line number Diff line change @@ -27,26 +27,14 @@ const focus = () => {
2727 </script >
2828
2929<template >
30- <label
31- class =" v-checkbox checkbox"
32- :class =" [ size, { 'is-disabled': disabled }]"
33- ref =" label"
34- :disabled =" disabled"
35- @click =" focus"
36- @keydown.prevent.enter =" label?.click()" >
37- <input
38- v-model =" value"
39- :indeterminate.prop =" indeterminate"
40- type =" checkbox"
41- ref =" input"
42- @click.stop
43- :disabled =" disabled"
44- :required =" required"
45- :name =" name"
46- :value =" nativeValue"
47- :true-value =" trueValue"
30+ <label class =" v-checkbox checkbox" :class =" [size, { 'is-disabled': disabled }]" ref =" label"
31+ v-bind =" disabled ? { disabled: true } : {}" @click =" focus" @keydown.prevent.enter =" label?.click()" >
32+ <input v-model =" value" :indeterminate.prop =" indeterminate" type =" checkbox" ref =" input" @click.stop
33+ :disabled =" disabled" :required =" required" :name =" name" :value =" nativeValue" :true-value =" trueValue"
4834 :false-value =" falseValue" />
4935 <span class =" check" :class =" type" />
50- <span class =" control-label" ><slot /></span >
36+ <span class =" control-label" >
37+ <slot />
38+ </span >
5139 </label >
5240</template >
Original file line number Diff line number Diff line change @@ -54,30 +54,19 @@ const passiveClass = computed<string | undefined>(() => {
5454 </script >
5555
5656<template >
57- <label
58- class =" switch"
59- :class =" [
60- size,
61- {
62- 'is-disabled': disabled,
63- 'is-rounded': rounded,
64- 'is-outlined': outlined,
65- }
66- ]"
67- :disabled =" disabled" >
68- <input
69- v-model =" value"
70- type =" checkbox"
71- @click.stop
72- :disabled =" disabled"
73- :name =" name"
74- :required =" required"
75- :value =" nativeValue"
76- :true-value =" trueValue"
77- :false-value =" falseValue" />
78- <span
79- class =" check"
80- :class =" [passiveClass, type]" />
81- <span class =" control-label" ><slot /></span >
57+ <label class =" switch" :class =" [
58+ size,
59+ {
60+ 'is-disabled': disabled,
61+ 'is-rounded': rounded,
62+ 'is-outlined': outlined,
63+ }
64+ ]" v-bind =" disabled ? { disabled: true } : {}" >
65+ <input v-model =" value" type =" checkbox" @click.stop :disabled =" disabled" :name =" name" :required =" required"
66+ :value =" nativeValue" :true-value =" trueValue" :false-value =" falseValue" />
67+ <span class =" check" :class =" [passiveClass, type]" />
68+ <span class =" control-label" >
69+ <slot />
70+ </span >
8271 </label >
8372</template >
You can’t perform that action at this time.
0 commit comments