Skip to main content

View

Extends Component

Constructor​

constructor(leaf: WorkspaceLeaf);

Properties​

app​

app: App

icon​

icon: string
navigation: boolean

Whether or not the view is intended for navigation. If your view is a static view that is not intended to be navigated away, set this to false. (For example: File explorer, calendar, etc.) If your view opens a file or can be otherwise navigated, set this to true. (For example: Markdown editor view, Kanban view, PDF view, etc.)

leaf​

leaf: WorkspaceLeaf

containerEl​

containerEl: HTMLElement

Methods​

onOpen​

protected onOpen(): Promise<void>;

onClose​

protected onClose(): Promise<void>;

getViewType​

abstract getViewType(): string;

getState​

getState(): any;

setState​

setState(state: any, result: ViewStateResult): Promise<void>;

getEphemeralState​

getEphemeralState(): any;

setEphemeralState​

setEphemeralState(state: any): void;

getIcon​

getIcon(): IconName;

onResize​

onResize(): void;

Called when the size of this view is changed.

getDisplayText​

abstract getDisplayText(): string;

onPaneMenu​

onPaneMenu(menu: Menu, source: 'more-options' | 'tab-header' | string): void;

Populates the pane menu.

(Replaces the previously removed onHeaderMenu and onMoreOptionsMenu)