17 lines
516 B
JavaScript
17 lines
516 B
JavaScript
import { computed, inject, provide } from 'vue';
|
|
const SlotsContextKey = Symbol('SlotsContextProps');
|
|
export const useProvideSlots = props => {
|
|
provide(SlotsContextKey, props);
|
|
};
|
|
export const useInjectSlots = () => {
|
|
return inject(SlotsContextKey, computed(() => ({})));
|
|
};
|
|
const ContextKey = Symbol('ContextProps');
|
|
export const useProvideTableContext = props => {
|
|
provide(ContextKey, props);
|
|
};
|
|
export const useInjectTableContext = () => {
|
|
return inject(ContextKey, {
|
|
onResizeColumn: () => {}
|
|
});
|
|
}; |