ny
22 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
export interface FieldNames {
  children?: string;
  key?: string;
  label?: string;
  value?: string;
}
export const treeSelectProps = {
  allowClear: { default: true, type: Boolean },
  disabled: { default: false, type: Boolean },
  dropdownMatchSelectWidth: { default: false, type: Boolean },
  fieldNames: {
    default: () => ({ label: 'fullName', value: 'id', children: 'children' }),
    type: Object as PropType<FieldNames>,
  },
  // 只能选择最后一层的数值
  lastLevel: { default: false, type: Boolean },
  // 只能选择最后一层的数值时,需要根据 lastLevelKey来判断是否最后一层
  lastLevelKey: { default: 'hasChildren', type: String },
  lastLevelValue: { default: false },
  modelValue: [String, Number, Array],
  multiple: { default: false, type: Boolean },
  options: { default: () => [], type: Array },
  placeholder: { default: '请选择', type: String },
  showIcon: { default: true, type: Boolean },
  showSearch: { default: true, type: Boolean },
  treeDefaultExpandAll: { default: true, type: Boolean },
  treeNodeFilterProp: { default: 'fullName', type: String },
  value: [String, Number, Array],
};