How to Access Child Method From the Parent in VueJS ? Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we are going to discuss how can we access the child method from the parent in VueJS. We need to create such a component that shows the use of accessing the child methods from the parent component. Approach:We will create two components ParentMethod and ChildComponent.ParentMethod vue.js component consists of a parent component which is named as “ParentMethod” and this method also includes a child component which is named as “ChildComponent” as we can also see in the code that the parent component also has a template and this template is with a view which contains a child component and a message called as displaydiv finally the component or the child component is passed as a method called “ParentMethodCall” as prop.ChildComponent vue.js component consists of a Child component which is named as “ChildComponent” it contains three different developments that are clickable they are labelled as “G”, “F” and “G”. We can also see that each of the div elements has an click event handler which is defined as “v-on:click” this triggers the “ClickEvent” method when it is clicked what happens then is that the click event updates the msg data property with a message that is concatenated with the data received as an argument after this it also logs the message to the console and then calls the method which is passed as a prop named call method with the same data.Example: This example shows the implementation of the above-explained approach. ParentMethod.vue <template> <div > <child-component :callMethod="parentMethodCall"> </child-component> <br/> <div class="msg">{{msg}}</div> </div> </template> <script> import Vue from "vue"; import ChildComponent from "@/components/ChildComponent"; export default { components: { ChildComponent: ChildComponent }, name: "ParentMethod", data() { return { msg: "MSG from parent method:" }; }, methods: { parentMethodCall: function(data) { this.msg = "MSG from parent method: " + data; console.log(this.msg); } } }; </script> <style scoped> .msg{ color: green; font-size: 15px; } </style> ChildComponent.vue <template> <div> <div style="cursor:pointer;" v-on:click="clickEvent('G')">G</div> <div style="cursor:pointer;" v-on:click="clickEvent('F')">F</div> <div style="cursor:pointer;" v-on:click="clickEvent('G')">G</div> <div class="msg">{{msg}}</div> </div> </template> <script> import Vue from "vue"; export default { name: "ChideComponent", data() { return { msg: "MSG from child method:" }; }, props: { callMethod: "" }, methods:{ clickEvent(data){ this.msg= "MSG from child method: "+ data console.log(this.msg); this.callMethod(data); } } }; </script> <style scoped> .msg{ color: red; font-size: 15px; } </style> Output: Once we execute both the files with the package in our project folder, we will see the following result. accessing child method from the parent Comment More infoAdvertise with us Next Article How to Access Child Method From the Parent in VueJS ? K kishankaushik Follow Improve Article Tags : JavaScript Web Technologies Geeks Premier League Vue.JS Geeks Premier League 2023 +1 More Similar Reads How to get Access to a Child Method From the Parent in VueJS ? When working with Vue.js components, it's common to encounter scenarios where you need to access a method inside the parent component that is defined in a child component. This can be useful for triggering specific actions or updating the child component's state.Below are the methods that can be use 4 min read How to Call a Parent Method from a Child Component in Vue 3 ? Vue.js is a JavaScript framework for building user interfaces. In Vue 3 parent and child component can communicate with each other through props and events. Props are used to pass the data from the parent to the child component and events are used to pass the data from child to parent component. The 3 min read How to call a parent method from child class in JavaScript? Inheritance in programming allows a class to derive methods and properties from another class, similar to how a child inherits traits from its parents. A child class can have its properties in addition to inherited ones. The deriving class is called a derived, sub, or child class, while the class it 3 min read How to Access child's state in React? Accessing the child state in from parent component directly is not possible. React follows unidirectional data flow where data is passed from child to parent. But we can access the child state in react with the help of ref and callback. PrerequisitesReact JSProps and StateReactJS RefHow to Access Ch 4 min read How to Update Parent Data from Child Component in VueJS? In Vue.js, communication between components is essential for building dynamic applications. One common scenario is updating the parent component's data from a child component. we will cover several ways to achieve this, including custom events, and v-model. Updating parent data from a child componen 3 min read How to Pass Value from One Child Component to Another in VueJS ? Vue.js is a JavaScript framework used in building powerful and beautiful user interfaces. The key feature of Vue.js is its component-based architecture that allows the developers to create reusable and modular components. In this article, we will learn how to pass value from one child component to a 3 min read How to navigate to a parent route from a child route? In angular, a root component that serves as the parent component of all the components and the rest of the other components can be called a Child Component to the root component. This structure is in a form of a tree where a component that is the parent of a child lies above the child component and 4 min read How to access index of the parent ng-repeat from child ng-repeat in AngularJS ? In this article, we will see How to access the index of the parent ng-repeat from child ng-repeat in AngularJS.In AngularJS applications, when we implement the nested ng-repeat directives and if we need to access the index of the parent ng-repeat from the child ng-repeat, then we can do this by usin 5 min read How to Check Response Data Length in VueJS ? Vue.js is an open-source progressive JavaScript framework for developing user interfaces, Vue js makes it simple and easy to use reusable components. While getting response data from any API it is sometimes necessary for us to read the response length so that we can iterate over the length to render 4 min read How to Bind the Background Image in VueJS ? In VueJS, the background images can be set from different types of properties like data property, computed property, or directly from an image source. In this article, we will see the different approaches to bind the background image in VueJS as listed below: Table of Content Using Inline StyleUsing 2 min read Like