1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-26 22:34:42 +03:00
guide/front/client/components/Search.vue
2018-10-28 18:29:54 +03:00

42 lines
779 B
Vue

<template>
<v-text-field
dark
solo
class="toollbar-search"
label="Search"
:value="searchInput"
@input="setSearchInput"
@keyup.enter.native="processSearchInput"
/>
</template>
<script lang="ts">
import Vue from 'vue'
import Component from 'vue-class-component'
@Component
export default class SearchField extends Vue {
processSearchInput() {
this.$router.push({ name: 'SearchResults', query: { query: this.searchInput } })
}
get searchInput() {
return this.$store.state.wiki.searchInput
}
setSearchInput(value: string) {
this.$store.commit('wiki/setSearchInput', value)
}
}
</script>
<style scoped>
.toollbar-search >>> div {
margin-bottom: 0 !important;
}
.toollbar-search >>> label {
font-size: 18px;
}
</style>