跳转到内容
搜索文档

按选择器选择资源

最后更新 查看 MarkdownAgent 设置

ResourcesBySelector 组件允许您根据 pcx_content_typeproducts frontmatter 属性引入文档资源。

组件

import { ResourcesBySelector } from "~/components";

<ResourcesBySelector
	directory="workers/examples/"
	types={["example"]}
	filterables={["products"]}
/>

输入

  • directory string

    要在其中搜索资源的目录,相对于 src/content/docs/。例如,对于 Workers 教程,directory="workers/tutorials/"

  • filterables string[]

    要在前端过滤器下拉列表中显示的 frontmatter 属性数组。例如,filterables={["products"]} 将允许用户根据每个页面的 products frontmatter 进行过滤。

  • types string[]

    用于过滤哪些内容被引入该组件的 pcx_content_type 值数组。例如,types={["example"]}

  • products string[]optional

    用于过滤哪些内容被引入该组件的 products 值数组。例如,products={["D1"]}

  • showDescriptions booleanoptional (default true)

    如果设置为 false,将仅显示相关页面的标题,而不显示描述。

  • showLastUpdated booleanoptional (default false)

    如果设置为 true,将添加最后更新日期,该日期是在 updated frontmatter 值中添加的。

这篇文档对您有帮助吗?