SummaryContext.js 269 B

12345678
  1. import { inject, provide } from 'vue';
  2. export const SummaryContextKey = Symbol('SummaryContextProps');
  3. export const useProvideSummary = props => {
  4. provide(SummaryContextKey, props);
  5. };
  6. export const useInjectSummary = () => {
  7. return inject(SummaryContextKey, {});
  8. };