Global Component Composition
In the previous chapter, we learned how to use Composition API to create component logic and how to write custom reusable composables in a Vue application. There are many approaches to sharing similar logic between other components besides composables. In this chapter, we will learn how to use mixins, plugins, and how to render dynamic components.
By the end of this chapter, you will be ready to organize your code using mixins and plugins, achieve global composition, and keep code DRY (Don’t Repeat Yourself) in any project. You will also understand the advantages and drawbacks of global composition, thus deciding the right approach to maximize a component’s flexibility.
This chapter covers the following topics:
- Understanding mixins
- Understanding plugins
- Registering components globally
- Understanding component tags
- Writing functional components