docs: 更新文档内容及结构调整
- 修复文档中的格式问题和错误 - 新增功能文档:数据迁移和管理后台 - 调整文档目录结构,将管理后台移至功能分类 - 更新API文档中的字段说明和响应示例 - 优化后端配置文档,移除冗余内容
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
# 前端配置
|
||||
|
||||
**这里仅提供一套开箱即用的方案,如果是个人开发者可以根据 API 文档自行编写前端评论组件。**
|
||||
**这里仅提供一套开箱即用的方案,如果是个人开发者可以根据 [API 文档](../api/overview) 自行编写前端评论组件。**
|
||||
|
||||
## 评论组件初始化
|
||||
|
||||
在初始化 `CWDComments` 实例时,可以传入以下配置参数:
|
||||
|
||||
```html
|
||||
<script src="https://cwd-comments.zishu.me/cwd-comments.js"></script>
|
||||
<div id="comments"></div>
|
||||
<script src="https://cwd-comments.zishu.me/cwd-comments.js"></script>
|
||||
<script>
|
||||
const comments = new CWDComments({
|
||||
el: '#comments',
|
||||
apiBaseUrl: 'https://your-api.example.com',
|
||||
apiBaseUrl: 'https://your-api.example.com', // 你部署的后端接口地址
|
||||
});
|
||||
comments.mount();
|
||||
</script>
|
||||
@@ -20,12 +20,12 @@
|
||||
|
||||
### 参数说明
|
||||
|
||||
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
||||
| ------------ | ----------------------- | ---- | ---------------------------------------------------------------- | ------------------------- |
|
||||
| `el` | `string \| HTMLElement` | 是 | - | 挂载元素选择器或 DOM 元素 |
|
||||
| `apiBaseUrl` | `string` | 是 | - | API 基础地址 |
|
||||
| `theme` | `'light' \| 'dark'` | 否 | `'light'` | 主题模式 |
|
||||
| `pageSize` | `number` | 否 | `20` | 每页显示评论数 |
|
||||
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
||||
| ------------ | ----------------------- | ---- | --------- | ------------------------- |
|
||||
| `el` | `string \| HTMLElement` | 是 | - | 挂载元素选择器或 DOM 元素 |
|
||||
| `apiBaseUrl` | `string` | 是 | - | API 基础地址 |
|
||||
| `theme` | `'light' \| 'dark'` | 否 | `'light'` | 主题模式 |
|
||||
| `pageSize` | `number` | 否 | `20` | 每页显示评论数 |
|
||||
|
||||
头像前缀、博主邮箱和标识等信息由后端接口 `/api/config/comments` 提供,无需在前端进行配置。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user