LegacyContext.js 839 B

1234567891011121314151617181920212223242526
  1. /**
  2. * BaseSelect provide some parsed data into context.
  3. * You can use this hooks to get them.
  4. */
  5. import { inject, provide } from 'vue';
  6. var TreeSelectLegacyContextPropsKey = Symbol('TreeSelectLegacyContextPropsKey');
  7. // export const LegacySelectContext = defineComponent({
  8. // compatConfig: { MODE: 3 },
  9. // name: 'SelectContext',
  10. // props: {
  11. // value: { type: Object as PropType<LegacyContextProps> },
  12. // },
  13. // setup(props, { slots }) {
  14. // provide(
  15. // TreeSelectLegacyContextPropsKey,
  16. // computed(() => props.value),
  17. // );
  18. // return () => slots.default?.();
  19. // },
  20. // });
  21. export function useProvideLegacySelectContext(props) {
  22. return provide(TreeSelectLegacyContextPropsKey, props);
  23. }
  24. export default function useInjectLegacySelectContext() {
  25. return inject(TreeSelectLegacyContextPropsKey, {});
  26. }