---
title: "自动导入"
description: "Nuxt 3 采用最小摩擦的方式，这意味着在可能的情况下组件和可组合项会被自动导入。"
canonical_url: "https://nuxt.zhcndoc.com/docs/4.x/migration/auto-imports"
---
# 自动导入

> Nuxt 3 采用最小摩擦的方式，这意味着在可能的情况下组件和可组合项会被自动导入。

::note
在迁移文档的其余部分，你会注意到 Nuxt 和 Vue 的关键实用工具没有显式导入。这不是笔误；Nuxt 会为你自动导入这些工具，如果你已按照[说明](https://nuxt.zhcndoc.com/docs/4.x/migration/configuration#typescript)启用 Nuxt 的 TypeScript 支持，就应该可以获得完整的类型提示。
::

[阅读有关自动导入的更多信息](https://nuxt.zhcndoc.com/docs/4.x/guide/concepts/auto-imports)

## 迁移

1. 如果你在 Nuxt 2 中使用过 `@nuxt/components`，可以在 `nuxt.config` 中移除 `components: true`。如果你的配置更复杂，请注意，组件选项有所变化。更多信息请参阅[组件文档](https://nuxt.zhcndoc.com/docs/4.x/directory-structure/app/components)。

::tip
你可以查看 `.nuxt/types/components.d.ts` 和 `.nuxt/types/imports.d.ts`，以了解 Nuxt 如何解析你的组件和可组合的自动导入。
::


## Sitemap

See the full [sitemap](https://nuxt.zhcndoc.com/sitemap.md) for all pages.
