mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
52c9b5fbca
commit
4b02a8a846
11 changed files with 197 additions and 22 deletions
|
|
@ -18,6 +18,7 @@ export class Plugin {
|
|||
public data: any = {};
|
||||
public name: string;
|
||||
public topBarIcons: Element[] = [];
|
||||
public commands: ICommand[] = [];
|
||||
public models: {
|
||||
/// #if !MOBILE
|
||||
[key: string]: (options: { tab: Tab, data: any }) => Custom
|
||||
|
|
@ -55,6 +56,10 @@ export class Plugin {
|
|||
// 布局加载完成
|
||||
}
|
||||
|
||||
public addCommand(command: ICommand) {
|
||||
this.commands.push(command);
|
||||
}
|
||||
|
||||
public addIcons(svg: string) {
|
||||
document.body.insertAdjacentHTML("afterbegin", `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>${svg}</defs></svg>`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue