event.code-snippets 456 B

123456789101112131415161718192021
  1. {
  2. "event": {
  3. "prefix": "event",
  4. "body": [
  5. "import { CoolEvent, Event } from '@cool-midway/core';",
  6. "",
  7. "/**",
  8. " * 接收事件",
  9. " */",
  10. "@CoolEvent()",
  11. "export class xxxEvent {",
  12. " @Event('updateUser')",
  13. " async updateUser(msg, a) {",
  14. " console.log('ImEvent', 'updateUser', msg, a);",
  15. " }",
  16. "}",
  17. ""
  18. ],
  19. "description": "cool-admin event代码片段"
  20. }
  21. }