Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cdbkr
Created May 14, 2019 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdbkr/e33facedfaf4612251cb56b4a8e06fdc to your computer and use it in GitHub Desktop.
Save cdbkr/e33facedfaf4612251cb56b4a8e06fdc to your computer and use it in GitHub Desktop.
<template>
<div>
<div class="counter-text">
Counter is: {{ count }}
</div>
<div class="counter-controls">
<button @click="increase">
Increase
</button>
<button @click="decrease">
Decrease
</button>
</div>
</div>
</template>
<script lang="js">
export const INITIAL_COUNTER = 0;
export default {
name: 'Counter',
data () {
return {
count: INITIAL_COUNTER
};
},
methods: {
increase() {
this.count += 1;
},
decrease() {
this.count -= 1;
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment