Skip to main content

更改默认的所见即所得编辑器

¥Change the default WYSIWYG editor

要更改 Strapi 管理面板提供的默认所见即所得编辑器,你可以使用多种选项:

¥To change the default WYSIWYG editor provided with Strapi's admin panel, 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 });
},
};