On Vue in Slot usage

vue in the documentation about the slot is very short, and written in a very concise language, and coupled with its methods, data, computed commonly used options such as frequency of use, using the difference in order, which may cause initial contact slot developers prone "forget it, go back and learn, anyway, you can already write the basic components", so he closed the vue documentation.

1. Basic Concepts

Slot, which is slot, is a component of HTML template, this template is not displayed, and how the display is determined by the parent component. Because the slot is a template, so, for any one component, from the perspective of the type of template points, in fact, it can be divided into non-template slots and slot template into two categories.
Non-slot template is an html template , referring to the 'div, span, ul, table ' these, displaying and hiding non-slot templates and how to control the display by the plug itself; slot template is a slot, it is an empty shell, because it shows the hidden and finally what kind of html template display control by the parent component. But the position of the slot indeed show itself is determined by the sub-components, slot in a piece of writing in the future on display at the piece of template template component, the parent component pass over .

Slot

 

Guess you like

Origin www.cnblogs.com/taxpolat/p/11850052.html