fix gitbook build

This commit is contained in:
tangly1024
2023-07-08 13:20:20 +08:00
parent 10199ed983
commit 0cc92c26a4
6 changed files with 23 additions and 18 deletions

View File

@@ -1,7 +1,6 @@
import NavPostListEmpty from './NavPostListEmpty'
import { useRouter } from 'next/router'
import NavPostItem from './NavPostItem'
import { useGitBookGlobal } from '..'
/**
* 博客列表滚动分页
@@ -11,13 +10,13 @@ import { useGitBookGlobal } from '..'
* @constructor
*/
const NavPostList = (props) => {
const { filteredPosts } = useGitBookGlobal()
const { filteredPosts } = props
const router = useRouter()
let selectedSth = false
// 处理是否选中
filteredPosts.map((group) => {
filteredPosts?.map((group) => {
let groupSelected = false
for (const post of group?.items) {
if (router.asPath.split('?')[0] === '/' + post.slug) {