Search
 
SCRIPT & CODE EXAMPLE
 

HTML

vue emit

// This is in child component
// use this after some process in methods

this.$emit('event-name', 'Hello, I'm Suman') ——————┐
                                               	   │
// parent component                                │
<template>                                         │
  <child-component                                 │
	@event-name="someFuncToCall" <—————————————————┘
  >
  </child-component>
</template>
<script>
  export default {
    methods: {
      someFuncToCall(arg) {
        console.log(arg); //Hello, I'm Suman
      }
    }
  }
</script>
Comment

vue 3 emits

<template>
  <div>
    <p>{{ text }}</p>
    <button v-on:click="$emit('accepted')">OK</button>
  </div>
</template>
<script>
  export default {
    props: ['text'],
    emits: ['accepted']
  }
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: etiqueta negrita html 
Html :: html table header 
Html :: html article tag example 
Html :: how to make text appear at tope left in html 
Html :: same form two submits 
Html :: html-search-bar 
Html :: comment html 
Html :: fork me github ribbon code html css 
Html :: v-expansion-panel example 
Html :: how to start new line in html 
Html :: html place div on background image 
Html :: tags 
Html :: can se have same id for radio button in html 
Html :: how to horizontal line in html 
Html :: semantic ui 
Html :: render html view react native 
Html :: aria list 
Html :: free form template html 
Html :: how to link another page in form submit 
Html :: defer in html 
Html :: HTML-Whatsapp Spammer 
Html :: cara membuat persegi di html 
Html :: limite file input to jpg 
Html :: simplecss.org cdn 
Html :: common web server ports 
Html :: html to jade 
Html :: passing parameters from C# to js fucntions 
Html :: lan ips 
Html :: sample code html header template code 
Html :: onclick video popup in html 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =