Skip to content

Commit

Permalink
New translations custom.md (Chinese Simplified)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Apr 4, 2024
1 parent 2cd9203 commit 3f92db5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions guide/content/zh/plugins/sanic-ext/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ title: Sanic 扩展 - 自定义

22.9版本添加了 `Extend.register` [method](#extension-preregistration)。 这使得向应用程序添加自定义扩展变得非常容易。

## 扩展的解析度
## 扩展的构成

所有扩展必须是子类“扩展”
所有的扩展都必须继承自 Extension 类

### 必填

- `name`: 按惯例, 名称是一个小写字符串
- `启动`: 添加扩展时运行的方法
- `name`: 按惯例, 名称是一个纯小写字符串
- `startup`: 当扩展被添加时运行的方法

### 可选的
### 可选项

- `label`:返回MOTD中有关扩展的额外信息的方法
- `included`:返回是否启用扩展名布尔值的方法 (可以用来检查配置状态)
- `label`: 一个在 MOTD 中返回有关扩展的附加信息的方法
- `included`: 一个返回布尔值的方法,用于确定扩展是否应该启用(例如,可以用于检查配置状态)

### 示例

Expand Down

0 comments on commit 3f92db5

Please sign in to comment.