fix: 修复注册自定义form组件名称首字母小写的问题

pull/49/head
chenminjie 2024-11-26 15:38:44 +08:00
parent a3592c8b28
commit 1a9a97fbc2
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import type { CustomComponentType } from './types';
import type { Component } from 'vue';
import { kebabToCamelCase } from '@vben/utils';
import { capitalizeFirstLetter, kebabToCamelCase } from '@vben/utils';
const componentMap = new Map<CustomComponentType | string, Component>();
// import.meta.glob() 直接引入所有的模块 Vite 独有的功能
@ -14,7 +14,7 @@ Object.keys(modules).forEach((key) => {
// ./components/ApiDict.vue
// 获取ApiDict
const compName = key.replace('./components/', '').replace('.vue', '');
componentMap.set(kebabToCamelCase(compName), mod);
componentMap.set(capitalizeFirstLetter(kebabToCamelCase(compName)), mod);
}
});