Answer the question
In order to leave comments, you need to log in
What are the advantages and disadvantages of slot vs method vs data vs prop?
https://ru.vuejs.org/v2/guide/components-slots.html
What prevents you from calling a getter from vuex, or passing some parameter and rendering the necessary elements, a component through if, or even using the render method and others?
Why is the slot worse and better?
Why and why use it?
Example situations?
Answer the question
In order to leave comments, you need to log in
slot is a "hole". Part of the parent component can be embedded in it. And this part remains part of the parent.
Here's an example:
You're creating a button component and want the parent to be able to set the text.
Method 1 passing through an attribute:
When the value of the parent changes, the following happens:
<my-button>{{$props.text}}</my-button>
<my-button><slot></slot></my-button>
What prevents you from calling the getter from vuex
some parameter and render the necessary elements
or even use the render method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question