mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 20:18:22 +08:00
f0385d7c24
* feat: tree * refactor: select * refactor: select * refactor: select * refactor: vc-tree-select * refactor: tree-select * refactor: tree-select * feat: add showLeafIcon * refactor: remove lod vc-tree-select * feat: tree-select add tag-render * refactor: cascader * refactor: cascader * refactor: cascader * refactor: cascader * fix: maxTagmaxTagPlaceholder not work
24 lines
752 B
TypeScript
24 lines
752 B
TypeScript
import type { InjectionKey } from 'vue';
|
|
import { provide, inject } from 'vue';
|
|
import type { DefaultOptionType, InternalFieldName, OnInternalSelect } from './TreeSelect';
|
|
|
|
export interface TreeSelectContextProps {
|
|
virtual?: boolean;
|
|
listHeight: number;
|
|
listItemHeight: number;
|
|
treeData: DefaultOptionType[];
|
|
fieldNames: InternalFieldName;
|
|
onSelect: OnInternalSelect;
|
|
}
|
|
|
|
const TreeSelectContextPropsKey: InjectionKey<TreeSelectContextProps> = Symbol(
|
|
'TreeSelectContextPropsKey',
|
|
);
|
|
|
|
export function useProvideSelectContext(props: TreeSelectContextProps) {
|
|
return provide(TreeSelectContextPropsKey, props);
|
|
}
|
|
export default function useInjectSelectContext() {
|
|
return inject(TreeSelectContextPropsKey, {} as TreeSelectContextProps);
|
|
}
|