Created
August 10, 2020 11:48
-
-
Save simonjcarr/d386600a47d1968bd59db26a8af08d0a 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> | |
| <div>{{ greeting }}</div> | |
| <div> | |
| The original number is: <strong>{{ myNumber }}</strong> | |
| </div> | |
| <div> | |
| The computed property makes it: <strong>{{ addOne }}</strong> | |
| </div> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| data() { | |
| return { | |
| greeting: "Hello World", | |
| myNumber: 1 | |
| }; | |
| }, | |
| computed: { | |
| addOne() { | |
| return this.myNumber + 1; | |
| } | |
| } | |
| }; | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment