-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webui: move search component to ab-search-bar.vue
- Loading branch information
1 parent
0177a89
commit 6367cc2
Showing
5 changed files
with
108 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<script lang="ts" setup> | ||
import {ref} from 'vue'; | ||
import {vOnClickOutside} from "@vueuse/components"; | ||
const showProvider = ref(false); | ||
const {providers, getProviders, provider, loading, onSearch} = useSearchStore(); | ||
onMounted(() => { | ||
getProviders(); | ||
}); | ||
function onSelect(site: string) { | ||
provider.value = site; | ||
showProvider.value = false; | ||
} | ||
</script> | ||
|
||
|
||
<template> | ||
<ab-search | ||
:provider="provider" | ||
:loading="loading" | ||
@search="onSearch" | ||
@select="() => showProvider = !showProvider" | ||
/> | ||
<div | ||
v-show="showProvider" | ||
v-on-click-outside="() => showProvider = false" | ||
abs top-84px | ||
left-540px w-100px | ||
rounded-12px | ||
shadow | ||
bg-white | ||
z-99 | ||
overflow-hidden | ||
> | ||
<div | ||
v-for="site in providers" | ||
:key="site" | ||
hover:bg-theme-row | ||
is-btn | ||
@click="() => onSelect(site)" | ||
> | ||
<div | ||
text-h3 | ||
text-primary | ||
hover:text-white | ||
p-12px | ||
truncate | ||
> | ||
{{ site }} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</template> | ||
|
||
|
||
<style lang="scss" scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters