app.config 参考
app.config.ts 全部配置项的字段、类型、默认值与说明,由 layer 的 nuxt.schema.ts 自动生成,与发布版本保持一致。需要了解某一项的用法时,从这里跳转到对应指南。
本页列出 app/app.config.ts 中可用的全部字段。表格由 layer/nuxt.schema.ts 生成,修改 schema 后运行 pnpm docs:reference 更新。
app.config 在运行时读取,修改后无需重新构建依赖;模块级开关(功能开关、AI 模型等)在 nuxt.config.ts 中配置,见 nuxt.config 选项。
i18n
多语言与界面语言配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
i18n.locale | string | "zh-CN" | 未启用 @nuxtjs/i18n 时的界面语言(如 zh-CN、en) |
theme
主题相关配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
theme.radius | number | 0.25 | 全局圆角值,单位 rem |
theme.blackAsPrimary | boolean | false | 是否将黑色设置为主色调 |
theme.icons | string | "lucide" | 全局图标集名称 |
theme.font | string | "editorial" | editorial 为衬线标题,sans 全站使用无衬线 |
theme.grain | boolean | false | 在页面背景叠加纸张颗粒质感 |
seo
SEO 相关配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
seo.titleTemplate | string | "%s" | 页面标题模板,使用 %s 作为占位符 |
seo.title | string | "" | 网站的默认标题 |
seo.description | string | "" | 网站的默认描述 |
header
页面头部配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
header.title | string | "" | Header 中显示的标题 |
header.avatar | string | "" | 头像图片 URL |
header.to | string | "/" | 点击标题跳转的地址 |
header.search | boolean | true | 是否显示搜索框 |
header.colorMode | boolean | true | 是否显示主题切换按钮 |
header.links | array | [] | Header 右侧的图标按钮 |
header.nav | array | [] | 顶部导航链接,label 支持按语言区分的对象,站内链接自动加语言前缀 |
header.mobileNav | array | [] | 移动端菜单中的导航链接,留空则沿用桌面端导航 |
docs
文档侧边栏配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
docs.categories | object | {} | 按顶层目录对侧边栏导航分组,键为目录 slug,值为分类列表 |
footer
页面底部配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
footer.credits | string | "" | Footer 中显示的版权信息 |
footer.socials | array | [] | Footer 中显示的社交媒体链接按钮 |
toc
目录配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
toc.title | string | "" | 目录区域的标题,留空则使用当前语言的内置文案 |
toc.bottom.title | string | "" | 目录底部区域的标题 |
toc.bottom.links | array | [] | 目录底部显示的链接按钮 |
aside
文档侧边栏配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
aside.filter.enabled | boolean | false | 在侧边栏顶部显示导航过滤框 |
aside.filter.placeholder | string | "" | 过滤框的占位提示文本,留空则使用当前语言的内置文案 |
aside.filter.threshold | number | 10 | 当前分组导航项总数达到该值时才显示过滤框 |
aside.filter.shortcut | string | "/" | 聚焦过滤框的键盘快捷键,留空则禁用 |
github
GitHub 仓库配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
github.owner | string | "" | GitHub 仓库所有者用户名 |
github.name | string | "" | GitHub 仓库名称 |
github.url | string | "" | GitHub 仓库完整 URL |
github.branch | string | "main" | 默认分支名称 |
github.rootDir | string | "" | 文档在仓库中的根目录 |
github.commitPath | string | "src" | CommitChangelog 推导组件 / composable 源文件路径时使用的仓库内目录 |
github.suffix | string | "vue" | CommitChangelog 推导源文件路径时使用的扩展名,不含点 |
github.since | string | "" | 只获取该 ISO 日期之后的提交,留空不限制 |
github.until | string | "" | 只获取该 ISO 日期之前的提交,留空不限制 |
github.perPage | number | 100 | 单个文件获取的提交数量上限 |
github.author | string | "" | 过滤特定作者的提交 |
github.casing | string | "auto" | 文件命名格式:auto(自动)、kebab(短横线)、camel(驼峰)、pascal(帕斯卡) |
github.dateFormat.locale | string | "zh-CN" | 日期的地区设置(如 zh-CN、en-US) |
github.dateFormat.options | object | {} | Intl.DateTimeFormat 的配置选项(JSON 对象) |
aiChat
AI 聊天助手配置
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
aiChat.floatingInput | boolean | true | 在文档页面底部显示浮动输入框 |
aiChat.explainWithAi | boolean | true | 在文档侧边栏中显示「用 AI 解释」按钮 |
aiChat.faqQuestions | array | [] | 显示的常见问题解答问题。支持简单格式(字符串数组)、分类格式(对象数组),或按 locale 分组的本地化对象 |
aiChat.shortcuts.focusInput | string | "meta_i" | 快捷键用于聚焦浮动输入框 |
aiChat.texts.title | string | "" | AI 聊天面板的标题文本 |
aiChat.texts.clearChat | string | "" | 清除聊天记录按钮的文本 |
aiChat.texts.close | string | "" | 关闭按钮的文本 |
aiChat.texts.placeholder | string | "" | 浮动输入框的占位符文本 |
aiChat.texts.lineBreak | string | "" | 换行的提示文本 |
aiChat.texts.trigger | string | "" | AI 聊天面板触发按钮的提示文本 |
aiChat.texts.explainWithAi | string | "" | 用 AI 解释按钮的文本 |
aiChat.icons.trigger | string | "i-custom-ai" | AI 聊天触发按钮的图标 |
aiChat.icons.explain | string | "i-lucide-bot-message-square" | 「用 AI 解释」按钮的图标 |
aiChat.icons.reasoning | string | "i-lucide-brain" | 推理/思考过程的图标 |
aiChat.icons.clearChat | string | "i-lucide-list-x" | 清除聊天记录按钮的图标 |
aiChat.icons.close | string | "i-lucide-panel-right-close" | 关闭按钮的图标 |
aiChat.icons.providers | object | {} | 用于映射不同 AI 提供商的图标(JSON 对象,键为提供商名称,值为图标名称) |