Various UI stuff (mainly implement mookup)
Fix lint Disable modern mode Fixes UI fixes Fixes Ignore .po~ files Fixes Fix homepage Fixes Fixes Mix format Fix tests Fix tests (yeah…) Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
22
js/src/components/SearchField.vue
Normal file
22
js/src/components/SearchField.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<b-input icon="magnify" type="search" rounded :placeholder="defaultPlaceHolder" v-model="searchText" @keyup.native.enter="enter" />
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||
import { RouteName } from '@/router';
|
||||
|
||||
@Component
|
||||
export default class SearchField extends Vue {
|
||||
@Prop({ type: String, required: false }) placeholder!: string;
|
||||
searchText: string = '';
|
||||
|
||||
enter() {
|
||||
this.$router.push({ name: RouteName.SEARCH, params: { searchTerm: this.searchText } });
|
||||
}
|
||||
|
||||
get defaultPlaceHolder(): string {
|
||||
// We can't use "this" inside @Prop's default value.
|
||||
return this.placeholder || this.$gettext('Search');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user