vue-vben-admin/src/hooks/web/useDesign.ts

23 lines
763 B
TypeScript
Raw Normal View History

2020-12-07 21:17:24 +08:00
import { useAppProviderContext } from '/@/components/Application';
2020-12-07 22:18:57 +08:00
// import { computed } from 'vue';
// import { lowerFirst } from 'lodash-es';
2020-12-07 21:17:24 +08:00
export function useDesign(scope: string) {
const values = useAppProviderContext();
2020-12-07 22:18:57 +08:00
// const $style = cssModule ? useCssModule() : {};
2020-12-07 21:17:24 +08:00
2020-12-07 22:18:57 +08:00
// const style: Record<string, string> = {};
2020-12-07 21:17:24 +08:00
// if (cssModule) {
2020-12-07 22:18:57 +08:00
// Object.keys($style).forEach((key) => {
// // const moduleCls = $style[key];
// const k = key.replace(new RegExp(`^${values.prefixCls}-?`, 'ig'), '');
// style[lowerFirst(k)] = $style[key];
2020-12-07 21:17:24 +08:00
// });
// }
return {
2020-12-07 22:18:57 +08:00
// prefixCls: computed(() => `${values.prefixCls}-${scope}`),
prefixCls: `${values.prefixCls}-${scope}`,
2020-12-07 21:17:24 +08:00
prefixVar: values.prefixCls,
// style,
};
}