Context.js 388 B

12345678910111213
  1. import { inject, provide, ref } from 'vue';
  2. var contextKey = Symbol('iconContext');
  3. export var useProvideIconContext = function useProvideIconContext(props) {
  4. provide(contextKey, props);
  5. return props;
  6. };
  7. export var useInjectIconContext = function useInjectIconContext() {
  8. return inject(contextKey, {
  9. prefixCls: ref('anticon'),
  10. rootClassName: ref(''),
  11. csp: ref()
  12. });
  13. };