Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self referencing components do not work in kebab-case #12730

Closed
Hulkmaster opened this issue Jan 16, 2025 · 3 comments
Closed

Self referencing components do not work in kebab-case #12730

Hulkmaster opened this issue Jan 16, 2025 · 3 comments
Labels
need more info Further information is requested

Comments

@Hulkmaster
Copy link

Vue version

3.5.13

Link to minimal reproduction

selfName: nameMatch && capitalize(camelize(nameMatch[1])),

Steps to reproduce

Works

filename: BaseComponent.vue
template:

<template>
  <div>
    <BaseComponent
      v-for="child in children"
      :key="child.id"
    />
  </div>
</template>

<script setup>
const children = ref([]);
</script>

Works

filename: base-component.vue
template:

<template>
  <div>
    <BaseComponent
      v-for="child in children"
      :key="child.id"
    />
  </div>
</template>

<script setup>
const children = ref([]);
</script>

DOES NOT work

filename: base-component.vue
template:

<template>
  <div>
    <base-component
      v-for="child in children"
      :key="child.id"
    />
  </div>
</template>

<script setup>
const children = ref([]);
</script>

Culprit is here:

selfName: nameMatch && capitalize(camelize(nameMatch[1])),

it transforms it to PascalCase, so kebab-case doesn't work

What is expected?

in reproduce

What is actually happening?

in reproduce

System Info

Any additional comments?

related issues:
vuejs/docs#765
#2827
#2821

@edison1105 edison1105 added has workaround A workaround has been found to avoid the problem 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Jan 17, 2025
@edison1105
Copy link
Member

I can't reproduce it in the Playground
Could you please provide a minimal reproduction?

@edison1105 edison1105 added need more info Further information is requested and removed 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem labels Jan 17, 2025
@Hulkmaster
Copy link
Author

it indeed works in playground, i'll try on clean app to reproduce

@Hulkmaster
Copy link
Author

I'm ashamed

it does not indeed work in our project (latest vue/vite)

but it does work correctly in plain vite-create project

i did not bother to try out on empty project first before creating an issue

sorry for wasting your time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants