Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to call parent method from child component

You should use this.$emit('myEvent') inside of your child component, when you want to trigger the method in the parent.

Then find you child component in the template of the parent and add an event catcher on it like this:

<template>
  <your-child-component @myEvent="myMethod"/>
</template>
If you want to add parameters to your method, you can add a second parameter to your emit like this:

this.$emit("myEvent", "My parameter")
For this to work you don't have to change anything in the event "catcher", as long as the method you call has a parameter
Comment

PREVIOUS NEXT
Code Example
Html :: read_html pandas skiprows function example 
Html :: Html Count div tags any website 
Html :: html postsql 
Html :: row card 
Html :: how to make a title bar logo html 
Html :: html film structure 
Html :: mise en forme 
Html :: html input avoid pre spacing 
Html :: how to create a link within an image in htm; 
Html :: add link to text using span html 
Html :: attribute syntax 
Html :: laravel route implicit binding 
Html :: html insert html snippets 
Html :: html count django model related_name 
Html :: html5 use of section tag in onepage template 
Html :: hit a perticaulr ancor tag id 
Html :: image 
Html :: display ppt in html 
Html :: default font size of html 
Html :: ahref html 
Html :: how to do auto composing on jupyter notebook 
Css :: how to make image not draggable in html 
Css :: write text in one line css 
Css :: css all ids starting with 
Css :: vertically and horizontally center a fixed div 
Css :: html how to change highlight color 
Css :: make ane element not selectable css 
Css :: remove the glow in bootstrap input 
Css :: underline height 
Css :: half circle css 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =