Attempt to implement settings syncing
This commit is contained in:
parent
b53b8758ba
commit
9824d2ba31
10 changed files with 118 additions and 10 deletions
32
view.ts
32
view.ts
|
|
@ -1,32 +0,0 @@
|
|||
import { ItemView,WorkspaceLeaf } from "obsidian";
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import { ReactView } from "./ReactView";
|
||||
|
||||
|
||||
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() {
|
||||
ReactDOM.render(
|
||||
React.createElement(ReactView),
|
||||
this.containerEl.children[1]
|
||||
)
|
||||
}
|
||||
|
||||
async onClose(){
|
||||
ReactDOM.unmountComponentAtNode(this.containerEl.children[1]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue