ant-design-vue/components/_util/hooks/usePrefixCls.ts
2021-05-12 21:06:53 +08:00

9 lines
383 B
TypeScript

import { computed, ComputedRef, inject } from 'vue';
import { defaultConfigProvider } from '../../config-provider';
export default (name: string, props: Record<any, any>): ComputedRef<string> => {
const configProvider = inject('configProvider', defaultConfigProvider);
const prefixCls = computed(() => configProvider.getPrefixCls(name, props.prefixCls));
return prefixCls;
};