Answer the question
In order to leave comments, you need to log in
Is it right to make components large?
I study vue and periodically review the code of sites in which almost the entire page (static) consists of components, for example:
<site-navigation></ ... >
<site-masthead></ ... >
<site-content></ ... >
<site-bars></ ... >
<site-footer>
Answer the question
In order to leave comments, you need to log in
The idea is that you are writing a table component. He doesn't care how many lines there are. It receives a certain array of objects and, in accordance with this data, creates a table on the page. The table can have 5 rows, or maybe 500. That's the profit of the components. You have created a table component that accepts a specific data format and now you can insert it in different places on the site, feed it different data sets. And every time everything will work as it should.
And if changes are needed, you just change the component itself and wherever it is used, in all 10 places on the site, your component will be modified automatically.
Look at some book, master class or course on vue, thoroughly, in order. One thing is better, but from and to. You have a systemic misunderstanding of the approach; it is not normal to solve this with point questions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question