Create a new component, V-test, and write a slot named after in the component’s WXML.





Remember to enable multi-slot support in the component’s JS code:





When the page page calls a component, for example, I want to add a text tag to the component V-test:





When will slots be available?

Such as, for example, we have a component v – test, it’s in the page 1, showing only a picture, and the page 2, want to be in the top right-hand corner of the picture shows a number of more, this is we can to display the number of tag, to replace with a slot, at the time of page 1, don’t use it, at the time of page 2, This requirement is fulfilled by using the text tag as the contents of the slot.