Wheel to increment number

This commit is contained in:
Jiiks 2018-02-05 00:40:01 +02:00
parent a783072cca
commit 4ba99b654e
1 changed files with 8 additions and 1 deletions

View File

@ -36,7 +36,14 @@
changeBy(positive) {
let step = this.setting.step == undefined ? 1 : this.settings.step;
this.change(this.setting.id, this.setting.value + (positive ? step : -step));
}
},
handleWheel() {} // No idea why this works but it does
},
beforeMount() {
window.addEventListener('wheel', this.handleWheel);
},
destroyed() {
window.removeEventListener('wheel', this.handleWheel);
}
}
</script>