SelectContext.js 367 B

123456789101112
  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. const SelectContextKey = Symbol('SelectContextKey');
  7. export function useProvideSelectProps(props) {
  8. return provide(SelectContextKey, props);
  9. }
  10. export default function useSelectProps() {
  11. return inject(SelectContextKey, {});
  12. }