Example View working
This commit is contained in:
parent
c228a70223
commit
b2d4fecec3
6 changed files with 111 additions and 116 deletions
27
view.ts
Normal file
27
view.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { ItemView,WorkspaceLeaf } from "obsidian";
|
||||
|
||||
export const VIEW_TYPE_EXAMPLE = "example-view"
|
||||
|
||||
export class ExampleView extends ItemView {
|
||||
constructor(leaf: WorkspaceLeaf) {
|
||||
super(leaf)
|
||||
}
|
||||
|
||||
getViewType() {
|
||||
return VIEW_TYPE_EXAMPLE
|
||||
}
|
||||
|
||||
getDisplayText() {
|
||||
return "Example View"
|
||||
}
|
||||
|
||||
async onOpen() {
|
||||
const container = this.containerEl.children[1];
|
||||
container.empty()
|
||||
container.createEl("h4", {text: "Example View"});
|
||||
|
||||
}
|
||||
async onClose(){
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue