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

Auto prefex component name from parent directories #67

Closed
drewbaker opened this issue Jul 3, 2020 · 1 comment · Fixed by #81
Closed

Auto prefex component name from parent directories #67

drewbaker opened this issue Jul 3, 2020 · 1 comment · Fixed by #81

Comments

@drewbaker
Copy link

With a complicated website, it's common to have lots of components in many different directories (see screenshot for example).

It would be great to allow for auto-prefix'ing of component names, based on parent directories.

I imagine it could work like this:

export default {
    components: [{ path: "~/components", prefix: true }]
}

So if you had this directory structure:

- /components
- - /block
- - - Work.vue

- - /form
- - - /group
- - - - Radios.vue

You'd get <block-work> and </form-group-radios> as components automatically.

Screen Shot 2020-07-03 at 2 26 38 PM

@ofek-a
Copy link

ofek-a commented Jul 13, 2020

This is what I thought the default behavior would be, otherwise, I don't think using @nuxt/components is very scalable/convenient to use if I have many folders and have to manually prefix them (or set the prefix in a config file).

This is how Vuepress used to do it, and I think it works well there.

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

Successfully merging a pull request may close this issue.

2 participants