UNPKG

@tplc/wot

Version:

59 lines (58 loc) 1.21 kB
import type { ComponentPublicInstance, ExtractPropTypes } from 'vue' export type AlignType = 'left' | 'center' | 'right' export type SortDirection = 0 | 1 | -1 export interface TableColumn { prop: string label: string width: string | number sortable?: boolean align?: AlignType sortDirection: SortDirection fixed?: boolean } export declare const tableColumnProps: { /** * 列对应字段 */ prop: { type: StringConstructor required: true } /** * 列对应字段标题 */ label: { type: StringConstructor required: true } /** * 列宽度,单位px */ width: { type: (NumberConstructor | StringConstructor)[] default: number } /** * 是否开启列排序 */ sortable: { type: BooleanConstructor default: boolean } /** * 是否固定本列 */ fixed: { type: BooleanConstructor default: boolean } /** * 列的对齐方式,可选值left,center,right */ align: { type: import('vue').PropType<AlignType> default: AlignType } } export type TableColumnProps = ExtractPropTypes<typeof tableColumnProps> export type TableColumnInstance = ComponentPublicInstance<TableColumnProps>