12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import { UPDATE_MODEL_EVENT } from '@element-plus/constants'
- import { useSizeProp } from '@element-plus/hooks'
- import { buildProps, definePropType, isArray } from '@element-plus/utils'
- import type { ExtractPropTypes } from 'vue'
- import type checkboxGroup from './checkbox-group.vue'
- import type { CheckboxValueType } from './checkbox'
- export type CheckboxGroupValueType = Exclude<CheckboxValueType, boolean>[]
- export const checkboxGroupProps = buildProps({
-
- modelValue: {
- type: definePropType<CheckboxGroupValueType>(Array),
- default: () => [],
- },
-
- disabled: Boolean,
-
- min: Number,
-
- max: Number,
-
- size: useSizeProp,
-
- label: String,
-
- fill: String,
-
- textColor: String,
-
- tag: {
- type: String,
- default: 'div',
- },
-
- validateEvent: {
- type: Boolean,
- default: true,
- },
- } as const)
- export const checkboxGroupEmits = {
- [UPDATE_MODEL_EVENT]: (val: CheckboxGroupValueType) => isArray(val),
- change: (val: CheckboxValueType[]) => isArray(val),
- }
- export type CheckboxGroupProps = ExtractPropTypes<typeof checkboxGroupProps>
- export type CheckboxGroupEmits = typeof checkboxGroupEmits
- export type CheckboxGroupInstance = InstanceType<typeof checkboxGroup>
|