-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathslds-checkbox-option.vue
53 lines (41 loc) · 1.01 KB
/
slds-checkbox-option.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
<div class="slds-checkbox">
<input
type="checkbox"
:checked="value"
:disabled="disabled"
:class="inputClassNames"
>
<label class="slds-checkbox__label">
<span class="slds-checkbox_faux"/>
<span v-if="inline" class="slds-form-element__label">
{{ option }}
</span>
</label>
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue"
export default defineComponent({
name: "CheckboxOption",
props: {
disabled: Boolean,
inline: Boolean,
option: { type: String, required: true },
/**
* Input value.
*/
value: Boolean,
},
computed: {
/**
* The CSS class names for the input.
*/
inputClassNames(): string {
let classNames = ""
if (this.disabled) classNames += " disabled"
return classNames
},
},
})
</script>