diff --git a/docs/developer-guide/theme/template-tag.md b/docs/developer-guide/theme/template-tag.md index 5849262..d798a2e 100644 --- a/docs/developer-guide/theme/template-tag.md +++ b/docs/developer-guide/theme/template-tag.md @@ -996,6 +996,108 @@ categories: name2(12) ``` +### 获取分类目录树结构(tree) + +#### 语法 + +```html +<@categoryTag method="tree"> +// do something + +``` + +参数: + +1. method:tree + +#### 返回参数 + +categories: + +```json +[ + { + "children": [ + { + "children": [], + "createTime": "2022-02-12T14:11:06.376Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" + } + ], + "createTime": "2022-02-12T14:11:06.376Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" + } +] +``` + +#### 示例 + +```html +<@categoryTag method="tree"> + + + +<#macro renderCategories categories> + + +``` + +输出: + +```html + +``` + ### 获取文章的所有分类(listByPostId) #### 语法 diff --git a/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md b/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md index 7ff3e23..d798a2e 100644 --- a/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md +++ b/versioned_docs/version-1.4.17/developer-guide/theme/template-tag.md @@ -996,6 +996,108 @@ categories: name2(12) ``` +### 获取分类目录树结构(tree) + +#### 语法 + +```html +<@categoryTag method="tree"> +// do something + +``` + +参数: + +1. method:tree + +#### 返回参数 + +categories: + +```json +[ + { + "children": [ + { + "children": [], + "createTime": "2022-02-12T14:11:06.376Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" + } + ], + "createTime": "2022-02-12T14:11:06.376Z", + "description": "string", + "fullPath": "string", + "id": 0, + "name": "string", + "parentId": 0, + "password": "string", + "slug": "string", + "thumbnail": "string" + } +] +``` + +#### 示例 + +```html +<@categoryTag method="tree"> + + + +<#macro renderCategories categories> + + +``` + +输出: + +```html + +``` + ### 获取文章的所有分类(listByPostId) #### 语法 @@ -1671,7 +1773,7 @@ teams: <#list teams as team>

${team.team}