Skip to content

服务与依赖

字数
82 字
阅读时间
1 分钟

WIP

本文档正在编写中……

ts
// 插件 A:提供了 greeting 服务
ipe
.
plugin
((
ctx
) => {
ctx
.
set
('greeting', (
name
: string) => {
console
.
log
(`hello, ${
name
}`)
}) }) // 插件 B:依赖了 greeting 服务
ipe
.
plugin
({
inject
: ['greeting'],
apply
(
ctx
) {
ctx
.
greeting
('world') // hello, world
}, })

贡献者

暂无相关贡献者

✏️ InPageEdit NEXT