docs(checkbox): optimize indeterminate demo

This commit is contained in:
07akioni 2024-01-24 00:35:35 +08:00
parent 341f2e6765
commit 40c2068b31
2 changed files with 35 additions and 27 deletions

View File

@ -4,11 +4,8 @@
<template>
<n-space item-style="display: flex;" align="center">
<n-checkbox
v-model:checked="value"
:indeterminate="indeterminate"
>
checkbox
<n-checkbox v-model:checked="value" :indeterminate="indeterminate">
Checkbox
</n-checkbox>
<n-checkbox v-model:checked="value" :indeterminate="indeterminate" />
<n-checkbox
@ -16,15 +13,22 @@
:indeterminate="indeterminate"
disabled
/>
<n-button size="small" @click="value = !value">
Check
</n-button>
<n-button
size="small"
@click="indeterminate = !indeterminate"
>
Indeterminate
</n-button>
<n-switch v-model:value="value">
<template #checked>
checked
</template>
<template #unchecked>
Unchecked
</template>
</n-switch>
<n-switch v-model:value="indeterminate">
<template #checked>
Indeterminate
</template>
<template #unchecked>
Not indeterminate
</template>
</n-switch>
</n-space>
</template>

View File

@ -4,10 +4,7 @@
<template>
<n-space item-style="display: flex;" align="center">
<n-checkbox
v-model:checked="value"
:indeterminate="indeterminate"
>
<n-checkbox v-model:checked="value" :indeterminate="indeterminate">
复选框
</n-checkbox>
<n-checkbox v-model:checked="value" :indeterminate="indeterminate" />
@ -16,15 +13,22 @@
:indeterminate="indeterminate"
disabled
/>
<n-button size="small" @click="value = !value">
选中
</n-button>
<n-button
size="small"
@click="indeterminate = !indeterminate"
>
部分选中
</n-button>
<n-switch v-model:value="value">
<template #checked>
选中
</template>
<template #unchecked>
没选中
</template>
</n-switch>
<n-switch v-model:value="indeterminate">
<template #checked>
部分选中
</template>
<template #unchecked>
非部分选中
</template>
</n-switch>
</n-space>
</template>