添加一种机制可以设置类名大写开头,但是不自动加主题前缀

This commit is contained in:
liaoxuezhi 2019-09-25 10:45:05 +08:00
parent e36c9de4b3
commit 0cce1ea9e5

View File

@ -48,7 +48,7 @@ export function makeClassnames(ns?: string) {
const fn = (...classes: ClassValue[]) => {
const str = cx(...(classes as any));
return str && ns ? str.replace(/(^|\s)([A-Z])/g, '$1' + ns + '$2') : str || '';
return str && ns ? str.replace(/(^|\s)([A-Z])/g, '$1' + ns + '$2').replace(/(^|\s)\:/g, '$1') : str || '';
};
ns && (fns[ns] = fn);