merge main & release 4.0.0

This commit is contained in:
tangly1024
2023-07-09 21:11:50 +08:00
parent 1fc45fa624
commit 2b3d1edd71
2 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ const NavPostList = (props) => {
let selectedSth = false
// 处理是否选中
filteredPostGroups.map((group) => {
filteredPostGroups?.map((group) => {
let groupSelected = false
for (const post of group?.items) {
if (router.asPath.split('?')[0] === '/' + post.slug) {
@@ -28,7 +28,7 @@ const NavPostList = (props) => {
})
// 如果都没有选中默认打开第一个
if (!selectedSth && filteredPostGroups && filteredPostGroups.length > 0) {
if (!selectedSth && filteredPostGroups && filteredPostGroups?.length > 0) {
filteredPostGroups[0].selected = true
}

View File

@@ -10,7 +10,7 @@ import NavPostList from './NavPostList'
*/
const PageNavDrawer = (props) => {
const { pageNavVisible, changePageNavVisible } = useGitBookGlobal()
const { filteredPosts } = props
const { filteredPostGroups } = props
const switchVisible = () => {
changePageNavVisible(!pageNavVisible)
}
@@ -23,7 +23,7 @@ const PageNavDrawer = (props) => {
' overflow-y-hidden shadow-card w-72 duration-200 fixed left-1 top-16 rounded py-2 bg-white dark:bg-gray-600'}>
<div className='dark:text-gray-400 text-gray-600 h-96 overflow-y-scroll p-3'>
{/* 所有文章列表 */}
<NavPostList filteredPosts={filteredPosts} />
<NavPostList filteredPostGroups={filteredPostGroups} />
</div>
</div>
</div>