部分组件bug修复

This commit is contained in:
tangly1024
2024-11-23 20:17:52 +08:00
parent 0d832e48ba
commit 401d7149a1
6 changed files with 49 additions and 37 deletions

View File

@@ -17,10 +17,6 @@ export const MenuItemCollapse = props => {
const router = useRouter()
if (!link || !link.show) {
return null
}
const selected = router.pathname === link.href || router.asPath === link.href
const toggleShow = () => {
@@ -36,6 +32,10 @@ export const MenuItemCollapse = props => {
setOpen(false)
}, [router])
if (!link || !link.show) {
return null
}
return (
<>
<div

View File

@@ -14,10 +14,11 @@ import Swiper from './Swiper'
const PostListRecommend = ({ latestPosts, allNavPages }) => {
// 获取推荐文章
const recommendPosts = getTopPosts({ latestPosts, allNavPages })
const title = siteConfig('MAGZINE_RECOMMEND_POST_TITLE', '', CONFIG)
if (!recommendPosts || recommendPosts.length === 0) {
return <PostListEmpty />
}
const title = siteConfig('MAGZINE_RECOMMEND_POST_TITLE', '', CONFIG)
return (
<div className={`w-full py-10 px-2 bg-[#F6F6F1] dark:bg-black`}>