S
S
SPART4K632021-05-03 11:35:30
Vue.js
SPART4K63, 2021-05-03 11:35:30

How do I properly structure components in nuxt?

Hello, I have a project on nuxt.js
I created components in the components folder and used them, but as soon as I wanted to structure my components it stopped working for me (It was expected)
, I created a navbar folder in the components folder and put my elements there, after which it stopped working correctly.
608fb5af72da1751172828.png
608fb5c7d0bdc452907493.png
Please tell me how to do it right

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2021-05-03
@SPART4K63

Disable auto-import of components in nuxt.config.js via components: falseand import them manually in the required component/page:

<script>
import logotype from '@/components/navbar/logotype'
export default {
  components: {
    logotype
  }
}
</script>

Or, if you still want auto-import, read the docs here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question