From c3f521c9903f03dcc7224d0008eea64c05f087d4 Mon Sep 17 00:00:00 2001 From: Plumbiu <99574369+Plumbiu@users.noreply.github.com> Date: Thu, 26 Jan 2023 14:07:08 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E7=AE=80=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/Articles/index.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/components/Articles/index.vue b/frontend/components/Articles/index.vue index 1c07e31..c515e3e 100644 --- a/frontend/components/Articles/index.vue +++ b/frontend/components/Articles/index.vue @@ -5,27 +5,25 @@ watchEffect(() => { }) let pagenum = 0 const isLoading = useState('isLoading', () => false) -const initialItem = await useFetchPostData() -const artlistData = useArtlist(initialItem) +const artlistData = useArtlist(await useFetchPostData()) const addArtListItem = () => { if (useScrollBottom()) { const timer = setTimeout(async () => { if (useScrollBottom()) { pagenum++ - const newItem = await useFetchPostData() - artlistData.value.push(...newItem) + const newArtlistData = await useFetchPostData() + artlistData.value = newArtlistData } clearTimeout(timer) }, 1000) } } -let EmployeeWindow onMounted(() => { - EmployeeWindow = window as any + const EmployeeWindow = window as any EmployeeWindow.addEventListener('scroll', addArtListItem) }) onUnmounted(() => { - EmployeeWindow = window as any + const EmployeeWindow = window as any EmployeeWindow.removeEventListener('scroll', addArtListItem) // 页面离开后销毁监听事件 }) From 6cb1b08fe4f1f2f3ac7bc540ea30d513efc8cd3b Mon Sep 17 00:00:00 2001 From: yizhankui <2669587581@qq.com> Date: Thu, 26 Jan 2023 22:12:15 +0800 Subject: [PATCH 2/7] style(Types): eidt Navs Types and DarkToggle style --- frontend/components/Navs/index.vue | 34 ++++++++++++++------------ frontend/components/Types/index.vue | 10 ++++++-- frontend/components/Uno/DarkToggle.vue | 3 ++- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/frontend/components/Navs/index.vue b/frontend/components/Navs/index.vue index 2533206..53baab9 100644 --- a/frontend/components/Navs/index.vue +++ b/frontend/components/Navs/index.vue @@ -5,7 +5,6 @@ const { data: NavList } = await useFetch('/api/global/navs') @@ -35,21 +34,24 @@ const { data: NavList } = await useFetch('/api/global/navs') div { display: block; } - +.switchThemes{ + position: absolute; + right: 80px; + border: 1px solid #1e80ff; + border-radius: 4px; + background: #1e80ffb8; +} .header { border-top: 1px solid #f1f1f1; border-bottom: 1px solid #f1f1f1; background-color: #ffffff; + position: fixed; + width: 100%; + z-index: 1; } .container { - display: flex; - height: 4rem; - width: 100%; - margin: auto; - align-items: center; - position: relative; - padding-left: 280px; + @apply flex h-19 w-full m-auto items-center relative px-94; } .nav-list ul { @@ -60,8 +62,8 @@ div { display: block; position: absolute; width: 50px; - left: 795px; - top: -1px; + left: 640px; + top: 3px; font-size: 12px; background: #ee502f; border-radius: 4px; @@ -75,10 +77,10 @@ div { justify-content: center; align-items: center; cursor: pointer; - height: 60px; + height: 4rem; width: 52px; text-align: center; - line-height: 60px; + line-height: 4rem; } .nav-list ul li:nth-child(1) { color: #1e80ff; diff --git a/frontend/components/Types/index.vue b/frontend/components/Types/index.vue index 7b93133..6a9de2e 100644 --- a/frontend/components/Types/index.vue +++ b/frontend/components/Types/index.vue @@ -6,7 +6,7 @@ const { data: TypeList } = await useFetch('/api/global/types')