mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 14:10:29 +08:00
25 lines
587 B
Plaintext
25 lines
587 B
Plaintext
|
{
|
||
|
"event": {
|
||
|
"prefix": "event",
|
||
|
"body": [
|
||
|
"import { Provide, Scope, ScopeEnum } from '@midwayjs/decorator';",
|
||
|
"import { CoolEvent, Event } from '@cool-midway/core';",
|
||
|
"",
|
||
|
"/**",
|
||
|
" * 接收事件",
|
||
|
" */",
|
||
|
"@Provide()",
|
||
|
"@Scope(ScopeEnum.Singleton)",
|
||
|
"@CoolEvent()",
|
||
|
"export class xxxEvent {",
|
||
|
" @Event('updateUser')",
|
||
|
" async updateUser(msg, a) {",
|
||
|
" console.log('ImEvent', 'updateUser', msg, a);",
|
||
|
" }",
|
||
|
"}",
|
||
|
""
|
||
|
],
|
||
|
"description": "cool-admin event代码片段"
|
||
|
}
|
||
|
}
|