跳转到内容
搜索文档

目录列表

最后更新 查看 MarkdownAgent 设置

The DirectoryListing component is used 596 times on 590 pages.

See all examples of pages that use DirectoryListing

Used 596 times.

Pages

Partials

使用 <DirectoryListing /> 显示特定文件夹的目录,该目录将以链接列表的形式呈现。

用法

import { DirectoryListing } from "~/components";

<p>
	<strong>Default</strong>
</p>
<DirectoryListing folder="workers/wrangler" />

<br />

<p>
	<strong>maxDepth</strong>
</p>
<DirectoryListing folder="workers/wrangler" maxDepth={2} />

<p>
	<strong>Descriptions</strong>
</p>
<DirectoryListing folder="workers/wrangler" descriptions />

<p>
	<strong>Button</strong>
</p>
<DirectoryListing folder="workers/wrangler" button />

属性

folder

类型: string

要列出其内容的文件夹路径。如果未提供,默认当前页面的路径。

button

类型: boolean 默认值: false

启用后,将列表显示为按钮样式卡片的 3 列网格(按字母顺序排序),而不是无序列表。卡片样式与我们的 LinkCard 组件相匹配。

descriptions

类型: boolean 默认值: false

启用后,显示列表中每个页面的 frontmatter description 字段。

maxDepth

类型: number 默认值: 1

控制要显示多少层嵌套页面。值 1 仅显示直接子页面,而更高的值将显示更深层次的嵌套。

tag

类型: string

可选,过滤列表以仅显示具有特定标签(tag)的页面。

关联内容类型

这篇文档对您有帮助吗?