1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-13 00:38:06 +00:00
bramw_baserow/web-frontend/modules/database/components/view/ViewSearch.vue
2021-04-08 14:30:26 +00:00

61 lines
1.2 KiB
Vue

<template>
<div>
<a
ref="contextLink"
class="header__filter-link"
:class="{
'active--primary': headerSearchTerm.length > 0,
}"
@click="$refs.context.toggle($refs.contextLink, 'bottom', 'right', 4)"
>
<i class="header__search-icon fas fa-search"></i>
{{ headerSearchTerm }}
</a>
<ViewSearchContext
ref="context"
:view="view"
:fields="fields"
:primary="primary"
:store-prefix="storePrefix"
@refresh="$emit('refresh', $event)"
@search-changed="searchChanged"
></ViewSearchContext>
</div>
</template>
<script>
import ViewSearchContext from '@baserow/modules/database/components/view/ViewSearchContext'
export default {
name: 'ViewSearch',
components: { ViewSearchContext },
props: {
view: {
type: Object,
required: true,
},
fields: {
type: Array,
required: true,
},
primary: {
type: Object,
required: true,
},
storePrefix: {
type: String,
required: true,
},
},
data: () => {
return {
headerSearchTerm: '',
}
},
methods: {
searchChanged(newSearch) {
this.headerSearchTerm = newSearch
},
},
}
</script>