Event and Data Handling in Vue.js
Major frameworks have gained their popularity not only from their ability to break down big pages into small reusable components but also due to the simplicity with which these components can communicate with each other.
In this chapter, we are going to focus on how the data flows between different components. This exchange of information between components is handled in two different ways: parent to child with properties and child to parent with events.
We are going to start this chapter by introducing a few changes that have been committed in the Companion App since our last chapter. These modifications can be used as a good guide to help you develop your skills and consolidate what you have already learned. We are going to revisit properties by learning about more advanced techniques such as validator
and required
by creating our first reusable component in the form of a simple button. Then, we will learn how to handle native events such as...