diff --git a/docs/components/form/checkbox.md b/docs/components/form/checkbox.md index ea2d71e6..25c9e27d 100644 --- a/docs/components/form/checkbox.md +++ b/docs/components/form/checkbox.md @@ -140,20 +140,40 @@ const checkedGroup = ref(['Vue']) ::: +## 全选 / 半选 (indeterminate) + +::: raw + + + 全选 + + + + Vue + Nuxt + + + +::: + ## 复选框 (Checkbox) 属性 -## 复选框组 (Checkbox Group) 属性 +
-## 复选框组 (Checkbox Group) 事件 +
\ No newline at end of file diff --git a/playground/src/example/checkbox/indeterminate.vue b/playground/src/example/checkbox/indeterminate.vue new file mode 100644 index 00000000..227e5efd --- /dev/null +++ b/playground/src/example/checkbox/indeterminate.vue @@ -0,0 +1,41 @@ + + + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 33006f9f..388d5123 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,153 +1,17 @@ \ No newline at end of file diff --git a/src/ui/checkbox/ShadcnCheckbox.vue b/src/ui/checkbox/ShadcnCheckbox.vue index 6d091727..8f788c20 100644 --- a/src/ui/checkbox/ShadcnCheckbox.vue +++ b/src/ui/checkbox/ShadcnCheckbox.vue @@ -1,6 +1,6 @@ @@ -56,17 +61,22 @@ import { computed } from 'vue' const emit = defineEmits(['update:modelValue', 'on-change']) -enum Size -{ - small = 'w-10 h-5', - default = 'w-14 h-6', - large = 'w-20 h-8' +enum Size { + small = 'h-5 min-w-[2.5rem]', + default = 'h-6 min-w-[3.5rem]', + large = 'h-8 min-w-[5rem]' } const ToggleSize = { - small: 'w-5 h-4', - default: 'w-6 h-6', - large: 'w-8 h-6' + small: 'w-4 h-4', + default: 'w-5 h-5', + large: 'w-7 h-7' +} + +const TextSize = { + small: 'text-xs', + default: 'text-sm', + large: 'text-base' } const props = withDefaults(defineProps<{ @@ -104,4 +114,4 @@ const onChange = (event: Event) => { emit('update:modelValue', newValue) emit('on-change', newValue) } - + \ No newline at end of file