From 87dd87ecc64d5325511c53fefdc818feb0971b53 Mon Sep 17 00:00:00 2001 From: eiinu Date: Mon, 20 Nov 2023 10:33:44 +0800 Subject: [PATCH] fix(build): componentName kebab-case -> PascalCase --- src/packages/utils/create/component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/utils/create/component.ts b/src/packages/utils/create/component.ts index ac9d1b6125..76db9d422d 100644 --- a/src/packages/utils/create/component.ts +++ b/src/packages/utils/create/component.ts @@ -1,4 +1,5 @@ import { App, defineComponent, ComponentOptions } from 'vue'; +const camelize = (s: string) => s.replace(/-./g, (x) => x[1].toUpperCase()); export function createComponent(name: string) { // TODO: It will be deprecated someday. @@ -6,7 +7,7 @@ export function createComponent(name: string) { return { componentName, create: function (_component: ComponentOptions) { - _component.name = componentName; + _component.name = 'Nut' + camelize('-' + name); _component.install = (vue: App) => { vue.component(_component.name as string, _component as any); };