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

Remove suffix (.component.vue) #259

Open
selimdoyranli opened this issue Jun 18, 2023 · 0 comments
Open

Remove suffix (.component.vue) #259

selimdoyranli opened this issue Jun 18, 2023 · 0 comments

Comments

@selimdoyranli
Copy link

selimdoyranli commented Jun 18, 2023

Under /components directory I have component structure like this

components
 ┣ Button
 ┃ ┣ PaperButton
 ┃ ┃ ┣ PaperButton.component.scss
 ┃ ┃ ┣ PaperButton.component.types.ts
 ┃ ┃ ┗ PaperButton.component.vue
 ┃ ┗ index.ts
 ┣ ButtonGroup
 ┃ ┣ ApplicationNavButtonGroup
 ┃ ┃ ┣ ApplicationNavButtonGroup.component.scss
 ┃ ┃ ┣ ApplicationNavButtonGroup.component.types.ts
 ┃ ┃ ┗ ApplicationNavButtonGroup.component.vue
 ┃ ┗ index.ts
 ┣ Card
 ┃ ┣ ReplyCard
 ┃ ┃ ┣ ReplyCard.component.scss
 ┃ ┃ ┣ ReplyCard.component.types.ts
 ┃ ┃ ┗ ReplyCard.component.vue
 ┃ ┣ ReviewCard
 ┃ ┃ ┣ ReviewCard.component.scss
 ┃ ┃ ┣ ReviewCard.component.types.ts
 ┃ ┃ ┗ ReviewCard.component.vue
 ┃ ┗ index.ts

...

My components config in nuxt.config.ts is like this:

components: [
     {
       path: '@/components',
       pathPrefix: false,
       extensions: ['vue']
     }
   ]

When I use a folder structure and config in this way, for example, this PaperButton is exported with the name PaperButtonComponent. It looks like this:

export { default as PaperButtonComponent } from '../..\\components\\Button\\PaperButton\\PaperButton.component.vue'

I looked at this from the components output in the .nuxt directory.

For this reason, where I want to use this component, I have to add Component expression to the end.

<template lang="pug">
.page.home-page
  .col-lg-7.mx-auto
    h1.home-page__title(v-html="$t('hero.home.title')")
    h2.home-page__description {{ $t('hero.home.description') }}

    ReviewCardComponent
</template>

But I don't want that. How can I do this while my component naming remains .component.vue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant