refactor(child): modify component name

This commit is contained in:
dragonish 2025-04-22 20:39:12 +08:00
parent 7023db61c5
commit 480480f288
No known key found for this signature in database
GPG key ID: 6F42FA9E807A5177
2 changed files with 10 additions and 10 deletions

View file

@ -1,6 +1,6 @@
import { Component, View } from "obsidian";
export class OutlineChildComponent extends Component {
export class ViewChildComponent extends Component {
private leafId: string;
private view: View | null;
private containerEl: HTMLElement | null;

18
main.ts
View file

@ -47,7 +47,7 @@ import {
editorModeField,
updateEditorMode,
} from "./components/view";
import { OutlineChildComponent } from "./components/outline";
import { ViewChildComponent } from "./components/child";
import { FolderSuggest } from "./components/suggest";
interface ObsidianEditor extends Editor {
@ -83,10 +83,10 @@ export default class HeadingPlugin extends Plugin {
settings: HeadingPluginSettings;
private outlineIdSet: Set<string> = new Set();
private outlineComponents: OutlineChildComponent[] = [];
private outlineComponents: ViewChildComponent[] = [];
private fileExplorerIdSet: Set<string> = new Set();
private fileExplorerComponents: OutlineChildComponent[] = [];
private fileExplorerComponents: ViewChildComponent[] = [];
async onload() {
await this.loadSettings();
@ -407,7 +407,7 @@ export default class HeadingPlugin extends Plugin {
this.outlineIdSet.add(leafId);
const oc = new OutlineChildComponent(
const vc = new ViewChildComponent(
leafId,
view,
viewContent,
@ -544,8 +544,8 @@ export default class HeadingPlugin extends Plugin {
}
);
this.outlineComponents.push(oc);
view.addChild(oc);
this.outlineComponents.push(vc);
view.addChild(vc);
view.register(() => {
this.outlineComponents = this.outlineComponents.filter(
(item) => !item.equal(leafId)
@ -572,7 +572,7 @@ export default class HeadingPlugin extends Plugin {
this.fileExplorerIdSet.add(leafId);
const oc = new OutlineChildComponent(
const vc = new ViewChildComponent(
leafId,
view,
navFilesContainer,
@ -720,8 +720,8 @@ export default class HeadingPlugin extends Plugin {
}
);
this.fileExplorerComponents.push(oc);
view.addChild(oc);
this.fileExplorerComponents.push(vc);
view.addChild(vc);
view.register(() => {
this.fileExplorerComponents = this.fileExplorerComponents.filter(
(item) => !item.equal(leafId)