useDesign.ts 881 B

1234567891011121314151617181920212223242526
  1. import { useAppProviderContext } from '@jeesite/core/components/Application';
  2. import { theme } from 'ant-design-vue';
  3. // import { computed } from 'vue';
  4. // import { lowerFirst } from 'lodash-es';
  5. export function useDesign(scope: string) {
  6. const values = useAppProviderContext();
  7. const token = theme.useToken();
  8. // const $style = cssModule ? useCssModule() : {};
  9. // const style: Record<string, string> = {};
  10. // if (cssModule) {
  11. // Object.keys($style).forEach((key) => {
  12. // // const moduleCls = $style[key];
  13. // const k = key.replace(new RegExp(`^${values.prefixCls}-?`, 'ig'), '');
  14. // style[lowerFirst(k)] = $style[key];
  15. // });
  16. // }
  17. return {
  18. // prefixCls: computed(() => `${values.prefixCls}-${scope}`),
  19. prefixCls: `${values.prefixCls}-${scope}`,
  20. prefixVar: values.prefixCls,
  21. hashId: token.hashId.value,
  22. // style,
  23. };
  24. }