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>
<DocSectionText v-bind="$attrs"> </DocSectionText>
<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>
</div>
<DocSectionCode :code="code" />
@ -13,11 +20,26 @@ export default {
return {
value: null,
code: {
basic: `<TriStateCheckbox v-model="value" />`,
basic: `
<TriStateCheckbox
v-model="value"
:pt="{
checboxBox: () => ({
class: value ? 'bg-green-500 border-white' : undefined
})
}"
/>`,
options: `
<template>
<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>
</div>
</template>
@ -34,7 +56,14 @@ export default {
composition: `
<template>
<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>
</div>
</template>