Last active
November 8, 2020 18:41
-
-
Save vdsabev/49a247afadba4d9a16e637fef6052f05 to your computer and use it in GitHub Desktop.
This file contains 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> | |
<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