1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
| import type { Arrayable } from '@vueuse/core';
| import type { FlattenedItem } from 'reka-ui';
|
| import type { Recordable } from '..\..\..\..\..\base\typings\src';
|
| export interface TreeProps {
| /** 单选时允许取消已有选项 */
| allowClear?: boolean;
| /** 非关联选择时,自动选中上级节点 */
| autoCheckParent?: boolean;
| /** 显示边框 */
| bordered?: boolean;
| /** 取消父子关联选择 */
| checkStrictly?: boolean;
| /** 子级字段名 */
| childrenField?: string;
| /** 默认展开的键 */
| defaultExpandedKeys?: Array<number | string>;
| /** 默认展开的级别(优先级高于defaultExpandedKeys) */
| defaultExpandedLevel?: number;
| /** 默认值 */
| defaultValue?: Arrayable<number | string>;
| /** 禁用 */
| disabled?: boolean;
| /** 禁用字段名 */
| disabledField?: string;
| /** 自定义节点类名 */
| getNodeClass?: (item: FlattenedItem<Recordable<any>>) => string;
| iconField?: string;
| /** label字段 */
| labelField?: string;
| /** 是否多选 */
| multiple?: boolean;
| /** 选择全部时的文字 */
| selectAllLabel?: string;
| /** 显示由iconField指定的图标 */
| showIcon?: boolean;
| /** 启用展开收缩动画 */
| transition?: boolean;
| /** 树数据 */
| treeData: Recordable<any>[];
| /** 值字段 */
| valueField?: string;
| }
|
| export function treePropsDefaults() {
| return {
| allowClear: false,
| autoCheckParent: true,
| bordered: false,
| checkStrictly: false,
| defaultExpandedKeys: () => [],
| defaultExpandedLevel: 0,
| disabled: false,
| disabledField: 'disabled',
| iconField: 'icon',
| labelField: 'label',
| multiple: false,
| showIcon: true,
| transition: true,
| valueField: 'value',
| childrenField: 'children',
| };
| }
|
|