This commit is contained in:
Vanessa 2023-05-30 00:27:47 +08:00
parent 52c9b5fbca
commit 4b02a8a846
11 changed files with 197 additions and 22 deletions

View file

@ -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>`);