Search filtering

This commit is contained in:
Leo Vasanko
2023-11-01 23:00:59 +00:00
parent 042f1b7f42
commit 52ecbc3d36
4 changed files with 63 additions and 37 deletions

View File

@@ -13,20 +13,17 @@ const isLoading = ref<boolean>(false)
const toggleSearchInput = () => {
showSearchInput.value = !showSearchInput.value;
if (!showSearchInput.value) {
searchQuery.value = '';
searchQuery.value = ''
}
};
}
const executeSearch = () => {
isLoading.value = true;
console.log(
documentStore.mainDocument
)
setTimeout(() => {
isLoading.value = false;
// Perform your search logic here
}, 2000);
};
const executeSearch = (ev: InputEvent) => {
// FIXME: Make reactive instead of this update handler
const query = (ev.target as HTMLInputElement).value
console.log("Searching", query)
documentStore.setFilter(query)
console.log("Filtered")
}
function createFileHandler() {
console.log("Creating file")
@@ -101,7 +98,7 @@ function download(){
<a-input-search
v-model="searchQuery"
class="margin-input"
v-on:keyup.enter="executeSearch"
@change="executeSearch"
@search="executeSearch"
:loading="isLoading"
/>