mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
9bbfd2a3e4
commit
8fe520f4af
8 changed files with 67 additions and 8 deletions
|
|
@ -1,12 +1,11 @@
|
|||
import {fetchPost} from "../util/fetch";
|
||||
import {App} from "../index";
|
||||
import {Plugin} from "./index";
|
||||
import {API} from "./API";
|
||||
|
||||
const getObject = (key: string) => {
|
||||
const api = {
|
||||
siyuan: {
|
||||
Plugin: Plugin
|
||||
}
|
||||
siyuan: API
|
||||
};
|
||||
// @ts-ignore
|
||||
return api[key];
|
||||
|
|
@ -37,7 +36,12 @@ export const loadPlugins = (app: App) => {
|
|||
console.error(`plugin ${item.name} does not extends Plugin`);
|
||||
return;
|
||||
}
|
||||
const plugin = new pluginClass({app, id: item.id, i18n: item.i18n});
|
||||
const plugin = new pluginClass({
|
||||
app,
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
i18n: item.i18n
|
||||
});
|
||||
app.plugins.push(plugin);
|
||||
plugin.onload();
|
||||
css += item.css || "" + "\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue