From 6f74a5bff41166c7bbe7ed87e3c7a4f3fc8e324f Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Fri, 4 Oct 2019 00:28:27 +0200 Subject: [PATCH] Input components now emit a "enter" event and our torrent input searches if "enter" event is received --- src/components/TorrentList.vue | 2 +- src/components/ui/SeasonedInput.vue | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/TorrentList.vue b/src/components/TorrentList.vue index 73dcef9..2bf97a7 100644 --- a/src/components/TorrentList.vue +++ b/src/components/TorrentList.vue @@ -78,7 +78,7 @@ justify-content: center;" v-if="editSearchQuery"> - +
diff --git a/src/components/ui/SeasonedInput.vue b/src/components/ui/SeasonedInput.vue index a78d046..4716af2 100644 --- a/src/components/ui/SeasonedInput.vue +++ b/src/components/ui/SeasonedInput.vue @@ -2,7 +2,7 @@
+ v-model="value" :placeholder="text" @keyup.enter="submit" @input="handleInput" /> show
@@ -19,6 +19,9 @@ export default { return { value: '', tempType: undefined } }, methods: { + submit(event) { + this.$emit('enter') + }, handleInput(value) { console.log('this.value', this.value) this.$emit('inputValue', this.value)