mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-16 21:26:36 +02:00
Keep search term in search input after commiting
This commit is contained in:
parent
e36ae64c83
commit
544594a7ad
|
@ -3,11 +3,11 @@
|
|||
<div class="input-wrapper">
|
||||
<input
|
||||
ref="searchInputField"
|
||||
v-model="searchInput"
|
||||
type="text"
|
||||
name="search"
|
||||
class="input"
|
||||
placeholder="Search messages…"
|
||||
@input="setSearchInput"
|
||||
@blur="closeSearch"
|
||||
/>
|
||||
</div>
|
||||
|
@ -97,10 +97,15 @@ export default {
|
|||
searchInput: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
setSearchInput(event) {
|
||||
this.searchInput = event.target.value;
|
||||
watch: {
|
||||
"$route.query.q"() {
|
||||
this.searchInput = this.$route.query.q;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.searchInput = this.$route.query.q;
|
||||
},
|
||||
methods: {
|
||||
closeSearch() {
|
||||
this.searchOpened = false;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue