Skip to content

Instantly share code, notes, and snippets.

@lamnd
Last active June 6, 2019 08:41
Show Gist options
  • Select an option

  • Save lamnd/cad7846ced9f71f3d1083ca355478162 to your computer and use it in GitHub Desktop.

Select an option

Save lamnd/cad7846ced9f71f3d1083ca355478162 to your computer and use it in GitHub Desktop.
Child A
<template>
<div id="child-a">
<h2>Child A</h2>
<pre>data {{ this.$data }}</pre>
<hr/>
<button @click="changeScore">Change Score</button>
<span>Score: {{ localScore }}</span>
</div>
</template>
<script>
export default {
name: 'Child A',
props: ['score'],
data: function() {
return {
localScore : this.score
}
},
methods: {
changeScore() {
this.localScore += 100;
//this.$emit("updateScore", this.localScore);
},
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment