--- title: 进阶组件交互演示 description: 实际体验搜索排序分页、API 参数、图片对比、术语 popover、自测和文件下载。 navigation: icon: lucide-sliders-horizontal --- 本页使用真实 MDC 渲染。数据和接口均为演示内容,属性与代码见 [进阶组件说明](/docs/简单文档/components/interactive-blocks)。 ## 可搜索排序的数据表 ::data-table --- title: 示例设备明细 pageSize: 2 exportable: true columns: - key: name label: 名称 - key: ports label: 端口数 - key: enabled label: 启用 rows: - name: 核心交换机 ports: 48 enabled: true - name: 接入交换机 2 ports: 24 enabled: true - name: 接入交换机 10 ports: 8 enabled: false - name: 实验交换机 ports: 4 enabled: false - name: 待登记设备 ports: null enabled: false --- :: ::data-table --- title: 空数据演示 columns: - key: name label: 名称 rows: [] --- :: ## 接口与参数 :::api-endpoint{title="示例报告查询" method="get" path="/api/reports/{id}" auth="演示认证说明" :status="200"} 此处仅展示接口说明,不执行请求。 ::parameter-table --- title: 示例请求参数 parameters: - name: id type: string location: path required: true description: 示例报告标识 - name: verbose type: boolean default: false description: 是否包含明细 - name: legacy type: number default: 0 deprecated: true enum: [0, 1] description: 旧兼容字段 --- :: #request ```http GET /api/reports/demo HTTP/1.1 ``` #response ```json { "id": "demo", "status": "ready" } ``` ::: ## 图片对比 ::image-compare --- title: 图示对比 beforeSrc: /images/mdc/render-flow.svg afterSrc: /images/mdc/publish-flow.svg beforeAlt: 内容渲染流程图 afterAlt: 文档发布流程图 beforeLabel: 渲染流程 afterLabel: 发布流程 initialPosition: 50 --- :: ## 术语解释 页面使用 :glossary-term{term="SSR" definition="服务端渲染:由服务器生成页面的初始 HTML。"} 生成内容,随后进行 :glossary-term{term="Hydration" definition="客户端 Vue 接管服务端 HTML,并连接事件与响应式状态。"}。 ## 阅读自测 ::content-quiz --- question: 示例组件会自动调用上面的 API 吗? choices: - 会,加载页面就发送请求 - 不会,它仅展示接口文档 answer: 1 explanation: ApiEndpoint 展示说明与示例,不发送网络请求。 --- :: ::content-quiz --- question: 清单和自测会上传个人成绩吗? choices: - 不会,只在当前页面交互 - 会自动上传 answer: 0 explanation: 当前实现没有成绩上传或跨设备同步。 --- :: ## 下载示例 ::download-card{title="设备清单示例" href="/examples/devices.example.json" filename="devices.example.json" version="1.0" description="只使用文档示例地址,没有真实凭据。"} :: ## 选择包管理器 切换包管理器后,复制的是当前标签里的安装命令。下面这组依赖安装为开发依赖。 ::package-install{packages="nuxt @nuxt/content" :dev="true"} :: ## 留到下次的检查清单 带 `storageKey` 的清单保存在当前浏览器。刷新页面后仍保留勾选状态,其他清单不受影响;想重做时点击重置。 ::task-checklist --- title: 发布前检查 storageKey: release-check items: - label: 确认构建通过 checked: false - label: 预览文档和图片 checked: false --- :: ::task-checklist --- title: 独立检查 storageKey: independent-check items: - label: 确认构建通过 checked: false - label: 检查部署后的搜索 checked: false --- ::