From c5651255403aa6f9ddf7bd420b8e2bfedb5b9d96 Mon Sep 17 00:00:00 2001 From: guqing <38999863+guqing@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:22:33 +0800 Subject: [PATCH] docs: add docs for getBreadcrumbs of category finder (#384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What this PR does? 为分类 Finder API 新增的 getBreadcrumbs 方法提供文档 see also https://github.com/halo-dev/halo/pull/6135 ```release-note None ``` --- .../theme/finder-apis/category.md | 29 +++++++++++++++++++ .../theme/finder-apis/category.md | 29 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/docs/developer-guide/theme/finder-apis/category.md b/docs/developer-guide/theme/finder-apis/category.md index f9c6122..4a636f5 100644 --- a/docs/developer-guide/theme/finder-apis/category.md +++ b/docs/developer-guide/theme/finder-apis/category.md @@ -156,6 +156,35 @@ List<[#CategoryTreeVo](#categorytreevo)> ``` +## getBreadcrumbs(name) + +```js +categoryFinder.getBreadcrumbs('category-foo') +``` + +### 描述 + +获取分类树结构的路径节点,可以通过此方法来构建面包屑导航。 + +### 参数 + +- `name:string` - 分类的唯一标识 `metadata.name`,必填。 + +### 返回值 + +List<[#CategoryVo](#categoryvo)> + +### 示例 + +```html +
+``` + ## 类型定义 ### CategoryVo diff --git a/versioned_docs/version-2.17/developer-guide/theme/finder-apis/category.md b/versioned_docs/version-2.17/developer-guide/theme/finder-apis/category.md index f9c6122..4a636f5 100644 --- a/versioned_docs/version-2.17/developer-guide/theme/finder-apis/category.md +++ b/versioned_docs/version-2.17/developer-guide/theme/finder-apis/category.md @@ -156,6 +156,35 @@ List<[#CategoryTreeVo](#categorytreevo)> ``` +## getBreadcrumbs(name) + +```js +categoryFinder.getBreadcrumbs('category-foo') +``` + +### 描述 + +获取分类树结构的路径节点,可以通过此方法来构建面包屑导航。 + +### 参数 + +- `name:string` - 分类的唯一标识 `metadata.name`,必填。 + +### 返回值 + +List<[#CategoryVo](#categoryvo)> + +### 示例 + +```html + +``` + ## 类型定义 ### CategoryVo