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

how emit in input in vue

<input  @change="$emit('modelInput' , inputValueModel)"  >
Comment

how to emit a function in vue

this.$emit('myEvent')
Comment

PREVIOUS NEXT
Code Example
Html :: happy birthday code in html 
Html :: split screen html 
Html :: html code tag 
Html :: html make text bold 
Html :: coreui margin right 
Html :: subscript in html 
Html :: change the font-size on a label css 
Html :: Bootstrap Image Grid (Responsive) 
Html :: add html to page chrome extension 
Html :: etiqueta negrita html 
Html :: html include html page 
Html :: bootstrap box 
Html :: fork me github code 
Html :: html button 
Html :: html input get number 
Html :: HTML Table - Rowspan 
Html :: html with new line  
Html :: how to create bold text in html 
Html :: html elements list explained 
Html :: aria list 
Html :: html5 time input 
Html :: Tagging with multi-value select boxes 
Html :: handlerbars js conditional 
Html :: HTML <sup 
Html :: thymeleaf for each limit size 
Html :: email link with cc html 
Html :: how to create image link in html 
Html :: ol list showing without numbers 
Html :: How to insert an image in bootstrap 4 
Html :: html date input pick only date 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =