From aac1a7f43261ac0ad5f69f438d8e57c8034c7c26 Mon Sep 17 00:00:00 2001 From: Zhou Date: Sun, 6 Nov 2022 08:52:53 +0800 Subject: [PATCH] Update life-cycle.md --- docs/en-US/development/life-cycle.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/en-US/development/life-cycle.md b/docs/en-US/development/life-cycle.md index d6daab561b..f250b26a9d 100644 --- a/docs/en-US/development/life-cycle.md +++ b/docs/en-US/development/life-cycle.md @@ -1,39 +1,39 @@ -# 生命周期 +# Life cycle -## 应用的生命周期 +## Lifecycle of applications -## 插件的生命周期 +## Lifecycle of plugins - + -## 插件的生命周期方法 +## Lifecycle methods for plugins ```ts import { InstallOptions, Plugin } from '@nocobase/server'; export class MyPlugin extends Plugin { afterAdd() { - // 插件 pm.add 注册进来之后,主要用于放置 app.beforeLoad 的事件。 - } + // After the plugin pm.add is registered. Mainly used to place the app.beforeLoad event. + beforeLoad() { } beforeLoad() { - // 所有插件执行 load 之前,一般用于注册类和事件监听 + // Before all plugins are loaded. Generally used for registering classes and event listeners } async load() { - // 加载配置 + // Load configuration } async install(options?: InstallOptions) { - // 安装逻辑 + // Logic for installing } async afterEnable() { - // 激活之后 + // After activation } async afterDisable() { - // 禁用之后 + // After disable } async remove() { - // 删除逻辑 + // Logic for removing } }