TristateCheckbox pt demo updated

pull/3938/head
Bahadır Sofuoğlu 2023-05-08 15:59:27 +03:00
parent 5677fb5290
commit c7b96b1bd2
1 changed files with 33 additions and 4 deletions

View File

@ -1,7 +1,14 @@
<template> <template>
<DocSectionText v-bind="$attrs"> </DocSectionText> <DocSectionText v-bind="$attrs"> </DocSectionText>
<div class="card flex flex-column align-items-center gap-3"> <div class="card flex flex-column align-items-center gap-3">
<TriStateCheckbox v-model="value" /> <TriStateCheckbox
v-model="value"
:pt="{
checboxBox: () => ({
class: value ? 'bg-green-500 border-white' : undefined
})
}"
/>
<label for="checkbox">{{ value == null ? 'null' : value }}</label> <label for="checkbox">{{ value == null ? 'null' : value }}</label>
</div> </div>
<DocSectionCode :code="code" /> <DocSectionCode :code="code" />
@ -13,11 +20,26 @@ export default {
return { return {
value: null, value: null,
code: { code: {
basic: `<TriStateCheckbox v-model="value" />`, basic: `
<TriStateCheckbox
v-model="value"
:pt="{
checboxBox: () => ({
class: value ? 'bg-green-500 border-white' : undefined
})
}"
/>`,
options: ` options: `
<template> <template>
<div class="card flex flex-column align-items-center gap-3"> <div class="card flex flex-column align-items-center gap-3">
<TriStateCheckbox v-model="value" /> <TriStateCheckbox
v-model="value"
:pt="{
checboxBox: () => ({
class: value ? 'bg-green-500 border-white' : undefined
})
}"
/>
<label for="checkbox">{{ value == null ? 'null' : value }}</label> <label for="checkbox">{{ value == null ? 'null' : value }}</label>
</div> </div>
</template> </template>
@ -34,7 +56,14 @@ export default {
composition: ` composition: `
<template> <template>
<div class="card flex flex-column align-items-center gap-3"> <div class="card flex flex-column align-items-center gap-3">
<TriStateCheckbox v-model="value" /> <TriStateCheckbox
v-model="value"
:pt="{
checboxBox: () => ({
class: value ? 'bg-green-500 border-white' : undefined
})
}"
/>
<label for="checkbox">{{ value == null ? 'null' : value }}</label> <label for="checkbox">{{ value == null ? 'null' : value }}</label>
</div> </div>
</template> </template>