Skip to content

Instantly share code, notes, and snippets.

@vdsabev
Last active November 8, 2020 18:41
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 vdsabev/49a247afadba4d9a16e637fef6052f05 to your computer and use it in GitHub Desktop.
Save vdsabev/49a247afadba4d9a16e637fef6052f05 to your computer and use it in GitHub Desktop.
<template>
<div>
<button type="button" @click="decrement">-</button> <!-- we removed the argument here -->
<input type="text" :value="value" @input="setValue($event.target.value)" />
<button type="button" @click="increment">+</button> <!-- we removed the argument here -->
</div>
</template>
<script>
export default {
...
methods: {
...
increment() {
this.setValue(this.value + this.step);
},
decrement() {
this.setValue(this.value - this.step);
},
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment