LegacyContext.js 1.0 KB

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