1👍
you can use component events i.e $emit.
Below is example which will tell you how to use $emit. (https://vuejs.org/guide/components/events.html#emitting-and-listening-to-events)
Parent Component
<template>
<ChildComponent @updateTabsValue="updateTabsValue"/>
</template>
<script>
export default {
data(){
return {
tabsValue: 'tabs',
};
},
methods:{
updateTabsValue(val){
this.tabsValue = val;
}
},
}
</script>
Child Component
<template>
<button @click="$emit('updateTabsValue','newVal')"/>
</template>
- [Vuejs]-How to debug an imported reactive variable?
- [Vuejs]-Best way to load page data into div with VueJS
Source:stackexchange.com