There is a block:

<div id="main"> <div id="first_block"> <h1>Lorem ipsum dolor sit amet.</h1> <p>Lorem ipsum dolor sit amet consectetur.</p> </div> <div id="second_block"> <span>Lorem ipsum dolor sit amet consectetur adipisicing.</span> </div> </div> 

I'm starting to learn vue.js and I want to rewrite this block as a component, inside which there are more components. That is, the block with id = main is a component within which there are two components (id = first_block, id = second_block). At the same time, there are still components inside each of these two blocks (span, h1, p). How to implement a component inside a component?

  • one
    You should start by reading the documentation. In Russian, there is even. - zalex
  • I read about the basics of the components and the registration of the components, searched for information on the Internet on the question - I did not find the right answer - Sasha Lyamin
  • @ SashaLyamin use slots - Andrey Popov
  • @AndreyPopov If I write to the slot, for example, a block with id = "first_block", then this block will be considered a component? Because in the future I would like to remove unnecessary components. - Sasha Lyamin
  • one
    @SashaLamin, no, this block will not be considered a component unless you create a component by inserting this block there ... You need to read the documentation ... you obviously "float" in the bases of the components. - Andrey Popov

0