mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -8,6 +8,9 @@ export class EventBus<DetailType = any> {
|
||||
}
|
||||
|
||||
on(type: TEventBus, listener: (event: CustomEvent<DetailType>) => void) {
|
||||
if (type ==="loaded-protyle") {
|
||||
console.warn("0.8.8 将移除 loaded-protyle, 请使用 loaded-protyle-static 进行替代");
|
||||
}
|
||||
this.eventTarget.addEventListener(type, listener);
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +298,8 @@ const setHTML = (options: {
|
||||
options.afterCB();
|
||||
}
|
||||
protyle.app.plugins.forEach(item => {
|
||||
item.eventBus.emit("loaded-protyle", protyle);
|
||||
item.eventBus.emit("loaded-protyle", protyle); // 准备废弃
|
||||
item.eventBus.emit("loaded-protyle-static", {protyle});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
@@ -51,7 +51,7 @@ type TEventBus = "ws-main" |
|
||||
"open-siyuan-url-plugin" | "open-siyuan-url-block" |
|
||||
"paste" |
|
||||
"input-search" |
|
||||
"loaded-protyle" | "loaded-protyle-dynamic" |
|
||||
"loaded-protyle" | "loaded-protyle-dynamic" | "loaded-protyle-static" |
|
||||
"destroy-protyle"
|
||||
type TAVCol =
|
||||
"text"
|
||||
|
||||
Reference in New Issue
Block a user