#7750 - first-beta-review #95
|
@ -40,6 +40,11 @@ const search = async () => {
|
||||||
query: searchTerm.value ? { search: searchTerm.value } : {}
|
query: searchTerm.value ? { search: searchTerm.value } : {}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!searchTerm.value) {
|
||||||
|
emit('onSearchError');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (props.sqlQuery) {
|
if (props.sqlQuery) {
|
||||||
data = await jApi.query(props.sqlQuery, {
|
data = await jApi.query(props.sqlQuery, {
|
||||||
[props.searchField]: searchTerm.value
|
[props.searchField]: searchTerm.value
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<Teleport v-if="isHeaderMounted" to="#actions">
|
<Teleport v-if="isHeaderMounted" to="#actions">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<VnSearchBar :search-term="search" @on-search-error="items = []" />
|
<VnSearchBar
|
||||||
|
@on-search-error="
|
||||||
|
() => {
|
||||||
|
items = [];
|
||||||
|
search = '';
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:icon="viewTypeButtonContent.icon"
|
:icon="viewTypeButtonContent.icon"
|
||||||
:label="viewTypeButtonContent.label"
|
:label="viewTypeButtonContent.label"
|
||||||
|
|
Loading…
Reference in New Issue