Last active
February 2, 2017 11:53
-
-
Save andreipfeiffer/375af939356d1d757008099d48e514a0 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
// parent component | |
template: '<Child @save="saveData" />', | |
methods: { | |
saveData() {/**/}; | |
} | |
// child component | |
template: '<button @click="onClick">Save</button>', | |
methods: { | |
onClick() { | |
// emit a custom "save" event | |
this.$emit('save'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment