From f6fea6a6c1ee2e011c14e8b503759970d5a9ca53 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 23 Jun 2023 09:31:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/global.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/global.js b/lib/global.js index 5fdeaecc..2565cffa 100644 --- a/lib/global.js +++ b/lib/global.js @@ -106,6 +106,7 @@ const initTheme = () => { setTimeout(() => { const elements = document.querySelectorAll('[id^="theme-"]') if (elements?.length > 1) { + elements[elements.length - 1].scrollIntoView() // 删除前面的元素,只保留最后一个元素 elements[0].parentNode.removeChild(elements[0]) elements.pop() @@ -113,4 +114,5 @@ const initTheme = () => { }, 500) } } + export const useGlobal = () => useContext(GlobalContext)