Skip to content

Commit

Permalink
fix(build): componentName kebab-case -> PascalCase
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu committed Nov 20, 2023
1 parent 08fdf1e commit 87dd87e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/packages/utils/create/component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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.
const componentName = 'nut-' + name;
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);
};
Expand Down

0 comments on commit 87dd87e

Please sign in to comment.