N
N
Nikita Egorov2018-09-17 22:03:38
Vue.js
Nikita Egorov, 2018-09-17 22:03:38

Where do you put shared components and where do you put private ones?

Here is my vue template, there are folders like this:

src/components
src/pages

In pages I put the page components for routing, and in components I put the common components of all pages (haeder, nav, footer, sidebar, etc.). But let's say there is a component that is used only on one page. Where to put it?
So?
src/pages/page1/components/PrivateComponents
And how do you do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2018-09-17
@svupol

And what will happen if tomorrow it will be used on another page? Should I copy the folder? I would throw it in components. But there it is also better to divide by tree, so that everything does not lie at the root.
If you want to bind to a page, then it's better to do this
src/components/page1/component

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question