storj/web/satellite/src/components/common/VHeader.vue
Egon Elbre 0889866b17 web/: add @vue/component annotations
Some linters do not work properly without those annotations.
This was done with a batch replace.

Also needed to turn off two lint rules, they will be re-enabled in the
followup change. This way the batch change can be clearly separated from
manual modifications.

Change-Id: I891ae09689520edaba5588c1f2206766db2d2b90
2021-08-31 21:25:49 +03:00

66 lines
1.4 KiB
Vue

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
<template>
<div class="header-container">
<div class="header-container__buttons-area">
<slot />
</div>
<VSearch
ref="search"
:placeholder="placeholder"
:search="search"
/>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import VSearch from '@/components/common/VSearch.vue';
declare type searchCallback = (search: string) => Promise<void>;
declare interface ClearSearch {
clearSearch(): void;
}
// @vue/component
@Component({
components: {
VSearch,
},
})
export default class VHeader extends Vue {
@Prop({default: ''})
private readonly placeholder: string;
@Prop({default: () => ''})
private readonly search: searchCallback;
public $refs!: {
search: VSearch & ClearSearch;
};
public clearSearch(): void {
this.$refs.search.clearSearch();
}
}
</script>
<style scoped lang="scss">
.header-container {
width: 100%;
height: 85px;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
&__buttons-area {
width: auto;
display: flex;
align-items: center;
justify-content: space-between;
}
}
</style>