📝 update doc

This commit is contained in:
yanyongyu 2021-02-07 11:09:20 +08:00
parent 458ddaa167
commit b1c7f309f8

View File

@ -40,7 +40,6 @@ def funcA():
```python
from nonebot.plugin import export
export=export()
```
@ -49,12 +48,15 @@ export=export()
```python
export.vA = varA
export.fA = funcA
```
除此之外,也支持 `嵌套` 导出对象:
```python
export.sub.vA = varA
export.sub.fA = funcA
```
特别地,对于 `函数对象` 而言,`export` 支持用 `装饰器` 的方法来导出,因此,我们可以这样定义 `funcA`
```python
@ -110,5 +112,6 @@ require_A = require('pluginA')
```python
varA = require_A.vA
funcA = require_A.fA or require_A.funcA
```
这样,我们就在 `pluginB` 中成功导入了 `varA``funcA` 对象了。