You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
562 B
19 lines
562 B
3 years ago
|
import type { InjectionKey, Ref } from 'vue';
|
||
|
import { inject, provide } from 'vue';
|
||
|
|
||
|
export interface ExpandedRowProps {
|
||
|
componentWidth: Ref<number>;
|
||
|
fixHeader: Ref<boolean>;
|
||
|
fixColumn: Ref<boolean>;
|
||
|
horizonScroll: Ref<boolean>;
|
||
|
}
|
||
|
export const ExpandedRowContextKey: InjectionKey<ExpandedRowProps> = Symbol('ExpandedRowProps');
|
||
|
|
||
|
export const useProvideExpandedRow = (props: ExpandedRowProps) => {
|
||
|
provide(ExpandedRowContextKey, props);
|
||
|
};
|
||
|
|
||
|
export const useInjectExpandedRow = () => {
|
||
|
return inject(ExpandedRowContextKey, {} as ExpandedRowProps);
|
||
|
};
|