@farming-labs/nuxt-theme

中文文档
0.2.146发布于 2026/11/14MITTypeScriptES Module近 30 天下载 6016

Nuxt/Vue UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle

原始使用文档
文档目录7 节
  1. Install
  2. Configure the theme
  3. Render the docs UI
  4. Main exports
  5. Learn more
  6. License
  7. Optional AI loading

@farming-labs/nuxt-theme

The Vue and Nuxt UI layer and theme preset package for @farming-labs/docs.

It renders the docs shell, page content, table of contents, breadcrumbs, search, AI chat, API reference switcher, and theme controls. Content loading and Nitro handlers live in @farming-labs/nuxt.

Install

npm install @farming-labs/docs @farming-labs/nuxt @farming-labs/nuxt-theme @farming-labs/theme

The CLI can scaffold the complete Nuxt integration:

npx @farming-labs/docs@latest init

Configure the theme

// docs.config.ts
import { defineDocs } from "@farming-labs/docs";
import { fumadocs } from "@farming-labs/nuxt-theme";

export default defineDocs({
  entry: "docs",
  contentDir: "docs",
  theme: fumadocs(),
  nav: { title: "Docs", url: "/docs" },
});

Add the matching shared CSS in nuxt.config.ts:

export default defineNuxtConfig({
  css: ["@farming-labs/theme/default/css"],
});

Render the docs UI

<script setup lang="ts">
import { DocsContent, DocsLayout } from "@farming-labs/nuxt-theme";
import config from "~/docs.config";

const { data } = await useFetch("/api/docs", {
  query: { pathname: useRoute().path },
});
</script>

<template>
  <DocsLayout :tree="data.tree" :config="config">
    <DocsContent :data="data" :config="config" />
  </DocsLayout>
</template>

Main exports

  • DocsLayout, DocsContent, and DocsPage
  • TableOfContents, Breadcrumb, and ThemeToggle
  • SearchDialog, FloatingAIChat, and ApiReferenceSwitcher
  • Theme preset factories

Preset subpaths are fumadocs, pixel-border, darksharp, colorful, greentree, hardline, concrete, command-grid, and ledger. The fumadocs preset uses @farming-labs/theme/default/css; the other presets use the matching @farming-labs/theme/<preset>/css entrypoint.

Learn more

License

MIT

Optional AI loading

The floating AI trigger loads with the page. Its chat implementation loads on first activation and stays mounted after closing, so reopening keeps the conversation. Panel, modal, popover, full-modal, and custom triggers retain their existing markup and configuration.

版本与发布记录

@farming-labs/nuxt-theme 共发布 366 个版本,首次发布于 2026/02/22;过去 12 个月发布了 366 个版本。

版本发布日期距今
0.2.146latest2026/11/14今天
0.2.1452026/11/131 天前
0.2.1442026/11/131 天前
0.2.1432026/11/068 天前
0.2.1422026/11/068 天前
0.2.1412026/11/059 天前

其他发布通道:perf → 0.2.133-perf.1,beta → 0.2.139-beta.1。

关于 @farming-labs/nuxt-theme 的常见问题

@farming-labs/nuxt-theme 是什么?

Nuxt/Vue UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle

如何安装 @farming-labs/nuxt-theme?

在项目目录运行 npm install @farming-labs/nuxt-theme,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(>=3.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@farming-labs/nuxt-theme 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@farming-labs/nuxt-theme 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@farming-labs/nuxt-theme 可以商用吗?

@farming-labs/nuxt-theme 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@farming-labs/nuxt-theme 的下载量有多少?

根据 npm 官方下载统计,@farming-labs/nuxt-theme 在 2026/10/15 – 2026/11/13 这 30 天内被下载 6,016 次,日均约 201 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@farming-labs/nuxt-theme 还在维护吗?

最新版本 0.2.146 发布于 2026/11/14(今天);至今共发布 366 个版本,其中过去 12 个月发布了 366 个;首次发布于 2026/02/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。