Skip to content

Instantly share code, notes, and snippets.

@simonjcarr
Created August 10, 2020 11:48
Show Gist options
  • Select an option

  • Save simonjcarr/d386600a47d1968bd59db26a8af08d0a to your computer and use it in GitHub Desktop.

Select an option

Save simonjcarr/d386600a47d1968bd59db26a8af08d0a to your computer and use it in GitHub Desktop.
<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