UNPKG

yanzhen-design-vue

Version:

53 lines (52 loc) 1.41 kB
import { CSSProperties } from 'vue'; export interface Option { value: string | number; label?: any; disabled?: boolean; children?: Option[]; isLeaf?: boolean; [key: string]: any; } export type IconType = any; export interface BasicDataNode { checkable?: boolean; disabled?: boolean; disableCheckbox?: boolean; icon?: IconType; isLeaf?: boolean; selectable?: boolean; switcherIcon?: IconType; /** Set style of TreeNode. This is not recommend if you don't have any force requirement */ class?: string; style?: CSSProperties; slots?: Record<string, string>; [key: string]: any; } export interface DataNode extends BasicDataNode { children?: DataNode[]; key: string | number; title?: any; } export interface Entity { index: number; key: Key; pos: string; parent?: Entity; children?: Entity[]; } export interface DataEntity<TreeDataType extends BasicDataNode = DataNode> extends Omit<Entity, 'node' | 'parent' | 'children'> { node: TreeDataType; nodes: TreeDataType[]; parent?: DataEntity<TreeDataType>; children?: DataEntity<TreeDataType>[]; level: number; } export type Key = string | number; export type SingleValueType = Key[]; export interface FieldNames { value: string; label: string; children: string; [key: string]: any; } export type RawValueType = string | number;