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 && }