// 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>
<template>
<div>
<p>{{ text }}</p>
<button v-on:click="$emit('accepted')">OK</button>
</div>
</template>
<script>
export default {
props: ['text'],
emits: ['accepted']
}
</script>
<input @change="$emit('modelInput' , inputValueModel)" >
this.$emit('myEvent')
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 |