import { computed } from 'vue'; import type { Ref, InjectionKey, ComputedRef } from 'vue'; import { inject, provide } from 'vue'; export interface RowContext { gutter: ComputedRef<[number, number]>; wrap: ComputedRef; supportFlexGap: Ref; } export const RowContextKey: InjectionKey = Symbol('rowContextKey'); const useProvideRow = (state: RowContext) => { provide(RowContextKey, state); }; const useInjectRow = () => { return inject(RowContextKey, { gutter: computed(() => undefined), wrap: computed(() => undefined), supportFlexGap: computed(() => undefined), }); }; export { useInjectRow, useProvideRow }; export default useProvideRow;