So, we modularized our components, great, but how about communication between parent and child component? There are a couple of ways to do this, take Agular 1 for example, you can just create a two-way binded scope object between parent and child (directive). Things are bit different with Vue, customizing component v-model (feature introduced in 2.2.0) and custom events are two of the solutions, and here are the minimal examples for each approach:
So, we modularized our components, great, but how about communication between parent and child component? There are a couple of ways to do this, take Agular 1 for example, you can just create a two-way binded scope object between parent and child (directive). Things are bit different with Vue, customizing component v-model (feature introduced in 2.2.0) and custom events are two of the solutions, and here are the minimal examples for each approach:
customizing component v-model
Parent component
Child component
Custom event
Parent component
Child component