From ade0c79a3c83eba104c7175523dbdb496de87559 Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Fri, 15 Nov 2024 16:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BD=91=E5=9D=80=E5=AF=BC?= =?UTF-8?q?=E8=88=AA-=E7=BC=BA=E5=B0=91=E6=90=9C=E7=B4=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/adder/AdderPage.tsx | 23 ++++- src/layout/adder/GameAdder.tsx | 87 ++++++++-------- src/layout/adder/HotAdder.tsx | 138 ++++++++++--------------- src/layout/adder/WidgetAdder.tsx | 24 ++--- src/layout/adder/useAdderPageStore.tsx | 88 ++++++++++++++-- 5 files changed, 213 insertions(+), 147 deletions(-) diff --git a/src/layout/adder/AdderPage.tsx b/src/layout/adder/AdderPage.tsx index 4e22815..e2b3302 100644 --- a/src/layout/adder/AdderPage.tsx +++ b/src/layout/adder/AdderPage.tsx @@ -81,6 +81,7 @@ export default defineComponent(() => { const isGame = computed(() => layout.state.current === 0) const store = useAdderPageStore() const addTo = ref(layout.state.currentPage) + provide(AddToToken, addTo) onUnmounted(() => { store.type = 1 @@ -145,7 +146,27 @@ export default defineComponent(() => { /> - + { + if (store.type === 1) { + store.search(e) + } else if (store.type === 0) { + store.widgetSearchWords = e + } else if (store.type === 3) { + store.gameSearch = e + } + }} + class="w-[220px]" + placeholder={ + store.type === 0 + ? '搜索想要添加的组件' + : store.type === 1 + ? '搜索想要添加的网址导航' + : store.type === 2 + ? '' + : '搜索想要添加的游戏' + } + />