mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +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
25 lines
727 B
TypeScript
25 lines
727 B
TypeScript
/**
|
|
* BaseSelect provide some parsed data into context.
|
|
* You can use this hooks to get them.
|
|
*/
|
|
|
|
import type { InjectionKey } from 'vue';
|
|
import { inject, provide } from 'vue';
|
|
import type { BaseSelectProps } from '../BaseSelect';
|
|
|
|
export interface BaseSelectContextProps extends BaseSelectProps {
|
|
triggerOpen: boolean;
|
|
multiple: boolean;
|
|
toggleOpen: (open?: boolean) => void;
|
|
}
|
|
|
|
const BaseSelectContextKey: InjectionKey<BaseSelectContextProps> = Symbol('BaseSelectContextKey');
|
|
|
|
export function useProvideBaseSelectProps(props: BaseSelectContextProps) {
|
|
return provide(BaseSelectContextKey, props);
|
|
}
|
|
|
|
export default function useBaseProps() {
|
|
return inject(BaseSelectContextKey, {} as BaseSelectContextProps);
|
|
}
|