Created
February 12, 2018 01:07
-
-
Save coderdiaz/34f1b4494d898bf24ec9f9edb9cfccdd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="padre-component"> | |
<h1>Padre</h1> | |
<hijo @hijo:change="escucharHijo"></hijo> | |
<button @click.prevent="emitirEventoPadre"></button> | |
</span> | |
</template> | |
<script> | |
import Hijo from 'Hijo' | |
export default { | |
name: 'Padre', | |
methods: { | |
escucharHijo () { | |
console.log('Mensaje recibido de Hijo') | |
}, | |
emitirEventoPadre () { | |
this.$emit('padre:change') | |
} | |
} | |
components: { | |
Hijo | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment