search

Home  >  Q&A  >  body text

javascript - Custom subcomponent receives parent component data, how to use v-for to render multiple subcomponents


Code first

Now there are 4 objects passed to the child component. How to use v-for to render 4 child components? Should v-for be placed in the template of the parent component or in the child component

PHP中文网PHP中文网2750 days ago624

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-19 10:46:00

    It must be placed in the child component, because if you use v-for to render the child component directly in the parent component, you cannot display the data in the object array (regardless of slot)

    reply
    0
  • Cancelreply