diff --git a/src/layout/header/search/SearchHistory.tsx b/src/layout/header/search/SearchHistory.tsx
index 01239dc..e589a70 100644
--- a/src/layout/header/search/SearchHistory.tsx
+++ b/src/layout/header/search/SearchHistory.tsx
@@ -1,11 +1,10 @@
import { defineComponent } from 'vue'
import { OhVueIcon, addIcons } from 'oh-vue-icons'
-import { MdHistory, MdRemove } from 'oh-vue-icons/icons'
+import { MdHistory, MdRemove, RiCloseCircleLine } from 'oh-vue-icons/icons'
import useSearchConfigStore from './useSearchConfigStore'
import jump from '@/utils/jump'
import useSettingsStore from '@/settings/useSettingsStore'
-addIcons(MdHistory)
-addIcons(MdRemove)
+addIcons(MdHistory, RiCloseCircleLine)
export default defineComponent(() => {
const searchConfig = useSearchConfigStore()
const settings = useSettingsStore()
@@ -15,7 +14,7 @@ export default defineComponent(() => {
{searchConfig.history.map((item, idx) => (
{
jump(searchConfig.current.url + item)
}}
@@ -34,7 +33,7 @@ export default defineComponent(() => {
searchConfig.removeHistory(idx)
}}
>
-
+
))}
diff --git a/src/layout/header/search/SearchSuggestion.tsx b/src/layout/header/search/SearchSuggestion.tsx
index a924f3c..4691c42 100644
--- a/src/layout/header/search/SearchSuggestion.tsx
+++ b/src/layout/header/search/SearchSuggestion.tsx
@@ -23,7 +23,7 @@ export const Item = defineComponent({
return () => (
{
@@ -46,7 +46,7 @@ export default defineComponent(() => {
const searchConfig = useSearchConfigStore()
return () => (
-
+
- {
current={search.current}
num={1}
/>
+ {
+ search.addList.map((el, idx) => (
+
+
+
{el.name}
+
+
+ ))
+ }
{search.sugList.map((el, idx) => (
- {
)
const debouncedHandler = debounce((newValue) => {
console.log('数值改变并已防抖处理:', newValue)
- request("GET", `/api/app/searchBars`).then((res) => {
+ request("GET", `/api/app/searchBars?keyword=${newValue || 'undefine'}`).then((res) => {
addList.value = res
+ console.log(addList.value);
+
})
}, 500) //
watch(searchStr, (newValue) => {
@@ -111,6 +113,7 @@ export default defineStore('search', () => {
focus,
showSearchConfig,
current,
- sugList
+ sugList, addList
+
}
})