I have an app where users create a list of patients. Each patient (child component) contains a name and age. The app will calculate the number of patients and sum of all of the patient's age. How would I pass information from the child component to the parent component?
Note - In my <report>
component I am currently hard coding the total-age attribute value to 0.
Currently, I have an addPatient()
method addd to my Vue instance which pushes null into the patients
array. I feel like I should be pushing something else other then null
into this array. I have a v-for
for each patients
.