diff --git a/src/views/AppStoresTable.vue b/src/views/AppStoresTable.vue index c26da9e..f446efc 100644 --- a/src/views/AppStoresTable.vue +++ b/src/views/AppStoresTable.vue @@ -151,16 +151,27 @@ export default { } }) }, + handleHotKey(e) { + if (e.code == "ArrowLeft") { + this.$refs.carousel.prev() + } else if (e.code == "ArrowRight") { + this.$refs.carousel.next() + } + } }, mounted() { this.height = `${this.$el.clientHeight - 30}px` + document.onkeyup = this.handleHotKey + }, + beforeDestroy() { + document.onkeyup = null } }