onload done

This commit is contained in:
frostime 2023-06-03 16:34:30 +08:00
parent 4dbc215a0e
commit 9f8f1fb69e

View file

@ -19,9 +19,9 @@ const STORAGE_NAME = "menu-config";
const TAB_TYPE = "custom_tab"; const TAB_TYPE = "custom_tab";
const DOCK_TYPE = "dock_tab"; const DOCK_TYPE = "dock_tab";
export default class SamplePlugin extends Plugin { export default class PluginSample extends Plugin {
private customTab: () => any; private customTab: () => IModel;
private isMobile: boolean; private isMobile: boolean;
async onload() { async onload() {
@ -69,9 +69,9 @@ export default class SamplePlugin extends Plugin {
element: statusIconTemp.content.firstElementChild as HTMLElement, element: statusIconTemp.content.firstElementChild as HTMLElement,
}); });
let div = document.createElement("div"); let tabDiv = document.createElement("div");
new HelloExample({ new HelloExample({
target: div, target: tabDiv,
props: { props: {
name: this.i18n.name, name: this.i18n.name,
i18n: this.i18n.hello i18n: this.i18n.hello
@ -80,7 +80,7 @@ export default class SamplePlugin extends Plugin {
this.customTab = this.addTab({ this.customTab = this.addTab({
type: TAB_TYPE, type: TAB_TYPE,
init() { init() {
this.element.appendChild(div); this.element.appendChild(tabDiv);
console.log(this.element); console.log(this.element);
}, },
destroy() { destroy() {
@ -100,7 +100,7 @@ export default class SamplePlugin extends Plugin {
config: { config: {
position: "LeftBottom", position: "LeftBottom",
size: {width: 200, height: 0}, size: {width: 200, height: 0},
icon: "iconEmoji", icon: "iconSaving",
title: "Custom Dock", title: "Custom Dock",
}, },
data: { data: {