Skip to content

Commit

Permalink
fix protyle bug
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed Oct 27, 2023
1 parent 8be20e0 commit bc63535
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/hello.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export let app;
let time: string = "";
let ver: string;
let ver: string = "";
let divProtyle: HTMLDivElement;
let protyle: any;
Expand Down
41 changes: 20 additions & 21 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit bc63535

Please sign in to comment.