From e8d0a236dd41a8d19686ed03ffb180e4e3c33bc8 Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Fri, 15 Nov 2024 15:26:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BE=E6=A0=87=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E8=B7=9F=E9=9A=8F=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E5=9B=BE=E6=A0=87=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/grid/index.tsx | 17 ++++++++++++++--- src/layout/header/search/index.tsx | 11 ++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/layout/grid/index.tsx b/src/layout/grid/index.tsx index a9e4985..7d397a2 100644 --- a/src/layout/grid/index.tsx +++ b/src/layout/grid/index.tsx @@ -1,4 +1,4 @@ -import { computed, defineComponent, ref, toRaw } from 'vue' +import { computed, defineComponent, ref, toRaw, watch } from 'vue' import useLayoutStore from '../useLayoutStore' import { OhVueIcon, addIcons } from 'oh-vue-icons' import { MdAdd } from 'oh-vue-icons/icons' @@ -14,15 +14,26 @@ export default defineComponent(() => { const layout = useLayoutStore() const settings = useSettingsStore() const router = useRouterStore() + const scrollRef = ref() const container = useSortable( computed(() => layout.currentPage.list), ref('page') ) + watch( + () => layout.currentPage.list.length, + (cur, old) => { + if (cur > old) { + if (scrollRef.value) { + scrollRef.value.scrollTop = scrollRef.value.scrollHeight + } + + } + } + ) return () => (
{ const h = (e.target as any).scrollTop diff --git a/src/layout/header/search/index.tsx b/src/layout/header/search/index.tsx index 7bd8786..867c61c 100644 --- a/src/layout/header/search/index.tsx +++ b/src/layout/header/search/index.tsx @@ -23,18 +23,19 @@ export default defineComponent( props.isMini ? {} : { - top: layout.isCompact ? '40px' : layout.state.simple ? '230px' : '172px', - width: settings.state.searchWidth + 'rem' - } + top: layout.isCompact ? '40px' : layout.state.simple ? '230px' : '172px', + width: settings.state.searchWidth + 'rem' + } } >
@@ -58,7 +59,7 @@ export default defineComponent( onContextmenu={(e) => e.stopPropagation()} onKeydown={(e) => e.stopPropagation()} class="flex-1 h-full outline-none bg-transparent placeholder:text-slate-600 placeholder:tracking-widest text-slate-800 pr-4" - placeholder={`输入搜索 ${searchConfig.current.name}`} + placeholder={`请输入搜索内容`} />
{search.showSearchConfig && }