From 3a40fa7a25fa1d69eff6d9973b4509db7911e351 Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Thu, 28 Nov 2024 16:44:29 +0800 Subject: [PATCH] =?UTF-8?q?ai=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/grid/AiSetting.tsx | 29 ++++++++++++++++------------- src/utils/parent.ts | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/layout/grid/AiSetting.tsx b/src/layout/grid/AiSetting.tsx index 53bc101..ed70faf 100644 --- a/src/layout/grid/AiSetting.tsx +++ b/src/layout/grid/AiSetting.tsx @@ -11,9 +11,9 @@ export default defineComponent({ const settings = useSettingsStore() watch( () => ({ - autoSearch: settings.state.autoUseAi === 'show', + autoSearch: settings.state.autoUseAi === 'auto', showTabButton: settings.state.showPetOnTab, - isSearch: settings.state.autoUseAi === '' + ifSearch: settings.state.autoUseAi !== '' }), (val) => { @@ -22,9 +22,15 @@ export default defineComponent({ { autoSearch: val.autoSearch, showTabButton: val.showTabButton, - isSearch: val.isSearch + ifSearch: val.ifSearch } ]) + console.log({ + autoSearch: val.autoSearch, + showTabButton: val.showTabButton, + ifSearch: val.ifSearch + }); + }, { immediate: true @@ -111,7 +117,7 @@ export default defineComponent({ /> -
{ - settings.state.autoUseAi = 'show' - }} - onUpdate:checked={(e) => { - if (e) settings.state.showSider = 'auto' - else settings.state.showSider = 'show' + settings.state.autoUseAi = 'auto' }} + /> { - settings.state.autoUseAi = 'auto' + settings.state.autoUseAi = 'show' }} /> -
+ */} ) } diff --git a/src/utils/parent.ts b/src/utils/parent.ts index 70cf472..d34fdf7 100644 --- a/src/utils/parent.ts +++ b/src/utils/parent.ts @@ -9,7 +9,7 @@ export function sendParent( { autoSearch: boolean showTabButton: boolean - isSearch: boolean + ifSearch: boolean } ] ) {