You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/commands/createCustomComponent/main.js
+30-10Lines changed: 30 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,14 @@ import { loadAdminForthConfig } from './configLoader.js'; // Helper to load conf
5
5
import{generateComponentFile,generateLoginOrGlobalComponentFile,generateCrudInjectionComponent}from'./fileGenerator.js';// Helper to create the .vue file
6
6
import{updateResourceConfig,injectLoginComponent,injectGlobalComponent,updateCrudInjectionConfig}from'./configUpdater.js';// Helper to modify resource .ts file
7
7
8
+
functionsanitizeLabel(input){
9
+
returninput
10
+
.replace(/[^a-zA-Z0-9\s]/g,'')
11
+
.split(' ')
12
+
.map(word=>word.charAt(0).toUpperCase()+word.slice(1).toLowerCase())// Переводим первую букву в верхний регистр
13
+
.join('');
14
+
}
15
+
8
16
exportdefaultasyncfunctioncreateComponent(args){
9
17
console.log('This command will help you to generate boilerplate for component.\n');
10
18
@@ -88,8 +96,8 @@ async function handleFieldComponentCreation(config, resources) {
0 commit comments