Skip to main content

更改默认富文本编辑器

¥Change the default rich text editor

Strapi 的 管理面板 内置富文本编辑器。要更改默认编辑器,你可以使用以下几个选项:

¥Strapi's admin panel comes with a built-in rich text editor. To change the default editor, several options are at your disposal:

如果你选择使用扩展系统,请在 /src/admin/extensions 文件夹中创建你的 WYSIWYG 组件并将其导入管理面板的 /src/admin/app.[tsx|js] 入口点文件,然后使用 app.addFields() 函数声明新字段,如下所示:

¥If you choose to use the extensions system, create your WYSIWYG component in the /src/admin/extensions folder and import it in the admin panel's /src/admin/app.[tsx|js] entry point file, then declare the new field with the app.addFields() function as follows:

/src/admin/app.js
// The following file contains the logic for your new WYSIWYG editor👇
import MyNewWYSIGWYG from "./extensions/components/MyNewWYSIGWYG";

export default {
bootstrap(app) {
app.addFields({ type: "wysiwyg", Component: MyNewWYSIGWYG });
},
};