Skip to main content

使用 Strapi 内置插件

¥Using Strapi built-in plugins

👀 信息

本节从开发者的角度介绍如何使用 Strapi 内置插件。不是你要找的?阅读 插件介绍 并找到你的用例和推荐部分以从那里阅读。

¥This section is about using Strapi built-in plugins from a developer's perspective. Not what you're looking for? Read the plugins introduction and find your use case and recommended section to read from there.

内置插件

¥Built-in plugins

Strapi 附带以下内置插件,这些插件由 Strapi 核心团队官方维护和记录:

¥Strapi comes with the following built-in plugins that are officially maintained and documented by the Strapi core team:

自动插件发现

¥Automatic plugins discovery

Strapi 自动加载使用 npm 安装的插件。在底层,Strapi 扫描项目依赖的每个 package.json 文件,并查找以下声明:

¥Strapi automatically loads plugins installed with npm. Under the hood, Strapi scans every package.json file of the project dependencies, and looks for the following declaration:

"strapi": {
"kind": "plugin"
}

也可以手动启用或禁用已安装的插件。

¥Installed plugins can also be manually enabled or disabled.

手动启用/禁用插件

¥Manual enabling/disabling of plugins

要禁用插件而不卸载它,请将 /config/plugins.js 文件 中的 enabled 键切换为 false

¥To disable a plugin without uninstalling it, switch its enabled key to false in the /config/plugins.js file.