上下文对象提供了 NocoBase 的各项内置能力。不过有些能力只在 Plugin 里可用,有些只在组件里可用,有些两边都有但写法不同。先看一下总览:
this.xxx
ctx.xxx
this.context.api
ctx.api
this.t()
this.context.t
ctx.t
this.context.logger
ctx.logger
this.router.add()
ctx.router.navigate()
this.context.location
ctx.route
ctx.location
this.context.viewer
ctx.viewer