mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🐛 Fix name attribute could not be visited in the plugin constructor (#10071)
This commit is contained in:
parent
0d89274eb0
commit
796df79931
2 changed files with 6 additions and 5 deletions
|
|
@ -68,6 +68,12 @@ export class Plugin {
|
||||||
this.i18n = options.i18n;
|
this.i18n = options.i18n;
|
||||||
this.displayName = options.displayName;
|
this.displayName = options.displayName;
|
||||||
this.eventBus = new EventBus(options.name);
|
this.eventBus = new EventBus(options.name);
|
||||||
|
|
||||||
|
// https://github.com/siyuan-note/siyuan/issues/9943
|
||||||
|
Object.defineProperty(this, "name", {
|
||||||
|
value: options.name,
|
||||||
|
writable: false,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public onload() {
|
public onload() {
|
||||||
|
|
|
||||||
|
|
@ -64,11 +64,6 @@ const loadPluginJS = async (app: App, item: IPluginData) => {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
i18n: item.i18n
|
i18n: item.i18n
|
||||||
});
|
});
|
||||||
// https://github.com/siyuan-note/siyuan/issues/9943
|
|
||||||
Object.defineProperty(plugin, "name", {
|
|
||||||
value: item.name,
|
|
||||||
writable: false,
|
|
||||||
});
|
|
||||||
app.plugins.push(plugin);
|
app.plugins.push(plugin);
|
||||||
try {
|
try {
|
||||||
await plugin.onload();
|
await plugin.onload();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue