fix protyle bug

This commit is contained in:
frostime 2023-10-27 21:04:12 +08:00
parent 8be20e023c
commit bc635356dc
2 changed files with 21 additions and 22 deletions

View file

@ -6,7 +6,7 @@
export let app;
let time: string = "";
let ver: string;
let ver: string = "";
let divProtyle: HTMLDivElement;
let protyle: any;

View file

@ -85,27 +85,6 @@ export default class PluginSample extends Plugin {
element: statusIconTemp.content.firstElementChild as HTMLElement,
});
let tabDiv = document.createElement("div");
new HelloExample({
target: tabDiv,
props: {
app: this.app,
}
});
this.customTab = this.addTab({
type: TAB_TYPE,
init() {
this.element.appendChild(tabDiv);
console.log(this.element);
},
beforeDestroy() {
console.log("before destroy tab:", TAB_TYPE);
},
destroy() {
console.log("destroy tab:", TAB_TYPE);
}
});
this.addCommand({
langKey: "showDialog",
hotkey: "⇧⌘O",
@ -244,6 +223,26 @@ export default class PluginSample extends Plugin {
// this.loadData(STORAGE_NAME);
this.settingUtils.load();
console.log(`frontend: ${getFrontend()}; backend: ${getBackend()}`);
let tabDiv = document.createElement("div");
new HelloExample({
target: tabDiv,
props: {
app: this.app,
}
});
this.customTab = this.addTab({
type: TAB_TYPE,
init() {
this.element.appendChild(tabDiv);
console.log(this.element);
},
beforeDestroy() {
console.log("before destroy tab:", TAB_TYPE);
},
destroy() {
console.log("destroy tab:", TAB_TYPE);
}
});
}
async onunload() {