diff options
-rw-r--r-- | src/components/SearchInput.vue | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue index eb9c978..40c5a1d 100644 --- a/src/components/SearchInput.vue +++ b/src/components/SearchInput.vue | |||
@@ -6,8 +6,8 @@ | |||
6 | ref="search" | 6 | ref="search" |
7 | :value="value" | 7 | :value="value" |
8 | @input="search($event.target.value)" | 8 | @input="search($event.target.value)" |
9 | @keyup.enter.exact="$emit('search-open')" | 9 | @keyup.enter.exact="open()" |
10 | @keyup.alt.enter="$emit('search-open', '_blank')" | 10 | @keyup.alt.enter="open('_blank')" |
11 | /> | 11 | /> |
12 | </div> | 12 | </div> |
13 | </template> | 13 | </template> |
@@ -37,6 +37,12 @@ export default { | |||
37 | } | 37 | } |
38 | }, | 38 | }, |
39 | methods: { | 39 | methods: { |
40 | open: function (target = null) { | ||
41 | if (!this.$refs.search.value) { | ||
42 | return; | ||
43 | } | ||
44 | this.$emit("search-open", target); | ||
45 | }, | ||
40 | focus: function () { | 46 | focus: function () { |
41 | this.$emit("search-focus"); | 47 | this.$emit("search-focus"); |
42 | this.$nextTick(() => { | 48 | this.$nextTick(() => { |