Skip to content

Instantly share code, notes, and snippets.

@codetheorist
Created August 26, 2017 12:57
Show Gist options
  • Save codetheorist/28ceb46d98455ecba8fca88588f11a26 to your computer and use it in GitHub Desktop.
Save codetheorist/28ceb46d98455ecba8fca88588f11a26 to your computer and use it in GitHub Desktop.
VueJS Child Component with Emitted Event
<template>
<button @click="btnClick('Button Clicked!')">{{ slot }}</button>
</template>
<script>
export default {
name: 'vue-button-component',
methods: {
btnClick(data) {
this.$emit('button-click', data)
}
}
}
</script>
<style lang="scss">
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment