Working settings sync
This commit is contained in:
parent
9824d2ba31
commit
b87676d7b0
4 changed files with 12 additions and 5 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
|
@ -14,4 +14,11 @@ main.js
|
|||
data.json
|
||||
|
||||
#vscode
|
||||
.vscode
|
||||
.vscode
|
||||
|
||||
#buildfiles
|
||||
settings.js
|
||||
view/App.js
|
||||
ReactView.js
|
||||
settings.js
|
||||
view.js
|
||||
2
main.ts
2
main.ts
|
|
@ -21,7 +21,7 @@ export default class ExamplePlugin extends Plugin {
|
|||
this.addSettingTab(new ExampleSettingsTab(this.app, this));
|
||||
this.registerView(
|
||||
VIEW_TYPE_EXAMPLE,
|
||||
(leaf) => (this.view = new ExampleView(leaf))
|
||||
(leaf) => (this.view = new ExampleView(leaf, this))
|
||||
);
|
||||
this.addRibbonIcon("dice", "Activate view", () => { //activate view
|
||||
this.activateView();
|
||||
|
|
|
|||
5
view.tsx
5
view.tsx
|
|
@ -9,9 +9,10 @@ export const VIEW_TYPE_EXAMPLE = "example-view"
|
|||
|
||||
export class ExampleView extends ItemView {
|
||||
plugin: ExamplePlugin;
|
||||
constructor(leaf: WorkspaceLeaf) {
|
||||
constructor(leaf: WorkspaceLeaf, plugin: ExamplePlugin) {
|
||||
super(leaf)
|
||||
console.log(this.plugin.settings) }
|
||||
this.plugin = plugin
|
||||
}
|
||||
|
||||
getViewType() {
|
||||
return VIEW_TYPE_EXAMPLE
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ class App extends React.Component<any,any> {
|
|||
.then(res => res.json())
|
||||
.then(
|
||||
result => {
|
||||
console.log(result.data)
|
||||
this.setState({
|
||||
isLoaded: true,
|
||||
tasks: result.data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue