From c03abce852a7b31cff161c167e9173902b8bc641 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 17 Sep 2024 21:27:37 +0800 Subject: [PATCH] =?UTF-8?q?Magzine=E4=B8=BB=E9=A2=98=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/magzine/components/Catalog.js | 3 +- .../{TocDrawer.js => CatalogFloat.js} | 20 +++++++++---- .../magzine/components/CatalogFloatButton.js | 28 +++++++++++++++++++ themes/magzine/index.js | 7 +++-- 4 files changed, 49 insertions(+), 9 deletions(-) rename themes/magzine/components/{TocDrawer.js => CatalogFloat.js} (69%) create mode 100644 themes/magzine/components/CatalogFloatButton.js diff --git a/themes/magzine/components/Catalog.js b/themes/magzine/components/Catalog.js index b127d24a..630cf031 100644 --- a/themes/magzine/components/Catalog.js +++ b/themes/magzine/components/Catalog.js @@ -53,6 +53,7 @@ const Catalog = ({ toc, className }) => { setActiveSection(currentSectionId) const index = tocIds.indexOf(currentSectionId) || 0 tRef?.current?.scrollTo({ top: 28 * index, behavior: 'smooth' }) + console.log(tRef?.current) }, throttleMs) ) @@ -67,7 +68,7 @@ const Catalog = ({ toc, className }) => {