Summary
In this chapter, we have covered a couple of advanced topics such as slots, lifecycles, and refs. The aim of this chapter was not to provide you with all the information that you may need on these topics but to introduce you to these points so that you can practice them in your next development and continue to learn as you expand your knowledge of Vue.js.
We have learned how to use slots to expand the flexibility of our components. Slots and named slots can be used for simple cases, such as <button>
, style elements, such as <div>
, or for more advanced techniques, such as defining a page layout with different areas.
We then moved on to Template Ref
, a topic that we had partly introduced in an earlier chapter. We learned how Template Ref
can be used to access a component DOM element. This is defined as an advanced technique because, with all the available features offered by Vue.js, it is uncommon that you would need to use Template Ref
this way.
Lastly,...