I'm working with two components nested inside each other. The parent component has a click event that needs to modify the data value of the child component.
<template>
<div>
.....
.....
<my-component
:options="options">
</my-component>
</div>
.....
.....
</template>
<script>
...
...
data(){
}
methods:{
clickEvent(array_from_child){
this.array = array_from_child; //array is in my-component
}
}
components:{
....
}
</script>
I am looking for a way to trigger the clickEvent method when there is a change in the child element's data. How can I achieve this?