You are stuck inside a v-for loop through an array of data. You may be thinking, easy, I just set a default content inside the slot in, and then override it on the parent, which is exactly where I want your mindset to be-Pokemon. But you also want to give control to the parent of the information that is rendered in this space, for example, on the main content area of the card. Imagine that you are building a Pokemon card game, and you want to have a component that has some default slots for what is being displayed in the card. This time, we are going to look at the basic 's amped-up sister, the scoped slot. We learned how to create basic components that allow passing any sort of structure and data into them, and we took a look at how to create multi-slot components. In the last part of this article, we looked at the most basic form of Vue’s. Scoped slots allow us to expose a piece of data, through the scope, to the parent that is using it. In our previous adventure, we looked at Vue’s basic slots.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |