fix(content-docs): render category with no subitems as a normal link (#6495)

This commit is contained in:
Joshua Chen 2022-02-02 21:45:00 +08:00 committed by GitHub
parent 049b2c84c6
commit 3573b5e4a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 120 additions and 5 deletions

View file

@ -82,7 +82,13 @@ function generateHugeSidebarItems() {
function generateRecursive(maxLevel, currentLevel = 0) {
if (currentLevel === maxLevel) {
return [];
return [
{
type: 'link',
href: '/',
label: `Link (level ${currentLevel + 1})`,
},
];
}
const linkItems = [...Array(linksCount).keys()].map((index) => ({