layui/.svn/pristine/93/937623323e13084fad5925e37ac6d447488135ed.svn-base
2022-12-09 16:41:41 +08:00

40 lines
1.0 KiB
Plaintext

export type StringFn = () => string;
export type StringOrNumber = string | number;
export type KeysType = (number | string)[];
export type EditType = boolean | ("add" | "update" | "delete");
export interface OriginalTreeData {
title: StringFn | string;
id: StringOrNumber;
field: StringFn | string;
children?: OriginalTreeData[];
disabled?: boolean;
}
export interface ReplaceFieldsOptions {
id?: string;
children?: string;
title?: string;
}
export interface TreeProps {
checkedKeys?: KeysType;
expandKeys?: KeysType;
data: OriginalTreeData;
checkStrictly?: boolean | string;
showCheckbox?: boolean;
edit?: EditType;
collapseTransition?: boolean;
onlyIconControl?: boolean;
showLine?: boolean;
replaceFields?: ReplaceFieldsOptions;
}
export interface TreeEmits {
(e: "update:checkedKeys", keys: KeysType): void;
(e: "update:expandKeys", keys: KeysType): void;
(e: "node-click", node: OriginalTreeData, event: Event): void;
}
export type CustomKey = string | number;
export type CustomString = (() => string) | string;