Last active
June 6, 2019 08:41
-
-
Save lamnd/cad7846ced9f71f3d1083ca355478162 to your computer and use it in GitHub Desktop.
Child A
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 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