Skip to content

Commit d683e86

Browse files
committed
fix: index
1 parent 9d68189 commit d683e86

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/trem/plugin_dev/start.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ example/
2020

2121
擴充套件的入口點
2222

23+
### Class 形式
24+
2325
```js
2426
class Plugin {
2527
#ctx;
@@ -36,6 +38,16 @@ class Plugin {
3638
module.exports = Plugin;
3739
```
3840

41+
### Function 形式
42+
43+
```js
44+
module.exports = function (ctx) {
45+
ctx.on("load", () => {
46+
const { TREM, logger, MixinManager } = ctx;
47+
});
48+
};
49+
```
50+
3951
## info.json
4052

4153
定義擴充資訊的文件

0 commit comments

Comments
 (0)