useBaseProps.js 385 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 BaseSelectContextKey = Symbol('BaseSelectContextKey');
  7. export function useProvideBaseSelectProps(props) {
  8. return provide(BaseSelectContextKey, props);
  9. }
  10. export default function useBaseProps() {
  11. return inject(BaseSelectContextKey, {});
  12. }