mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 09:50:58 +08:00
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
import { buildProps, definePropType, mutable } from '@element-plus/utils'
|
|
import type { ExtractPropTypes } from 'vue'
|
|
import type Col from './col.vue'
|
|
|
|
export type ColSizeObject = {
|
|
span?: number
|
|
offset?: number
|
|
pull?: number
|
|
push?: number
|
|
}
|
|
export type ColSize = number | ColSizeObject
|
|
|
|
export const colProps = buildProps({
|
|
tag: {
|
|
type: String,
|
|
default: 'div',
|
|
},
|
|
span: {
|
|
type: Number,
|
|
default: 24,
|
|
},
|
|
offset: {
|
|
type: Number,
|
|
default: 0,
|
|
},
|
|
pull: {
|
|
type: Number,
|
|
default: 0,
|
|
},
|
|
push: {
|
|
type: Number,
|
|
default: 0,
|
|
},
|
|
xs: {
|
|
type: definePropType<ColSize>([Number, Object]),
|
|
default: () => mutable({} as const),
|
|
},
|
|
sm: {
|
|
type: definePropType<ColSize>([Number, Object]),
|
|
default: () => mutable({} as const),
|
|
},
|
|
md: {
|
|
type: definePropType<ColSize>([Number, Object]),
|
|
default: () => mutable({} as const),
|
|
},
|
|
lg: {
|
|
type: definePropType<ColSize>([Number, Object]),
|
|
default: () => mutable({} as const),
|
|
},
|
|
xl: {
|
|
type: definePropType<ColSize>([Number, Object]),
|
|
default: () => mutable({} as const),
|
|
},
|
|
} as const)
|
|
export type ColProps = ExtractPropTypes<typeof colProps>
|
|
export type ColInstance = InstanceType<typeof Col>
|