Reference Source
import Post from 'flarum/forum/components/Post'
public class | source

Post

Extends:

src/common/Component.js~Component → Post

Direct Subclass:

CommentPost, EventPost

Indirect Subclass:

DiscussionRenamedPost

The Post component displays a single post. The basic post template just includes a controls dropdown; subclasses must implement content and attrs methods.

Attrs

  • post

Member Summary

Public Members
public
public

Set up a subtree retainer so that the post will not be redrawn unless new data comes in.

Method Summary

Public Methods
public

Build an item list for the post's actions.

public

classes(string: *): string[]

Get the post's classes.

public

Get the post's content.

public

Get attributes for the post element.

public

Build an item list for the post's footer.

public

onbeforeupdate(vnode: *): *

public

oninit(vnode: *)

public

onupdate(vnode: *)

public

view(): *

Public Members

public loading: boolean source

public subtree: SubtreeRetainer source

Set up a subtree retainer so that the post will not be redrawn unless new data comes in.

Public Methods

public actionItems(): ItemList source

Build an item list for the post's actions.

Return:

ItemList

public classes(string: *): string[] source

Get the post's classes.

Params:

NameTypeAttributeDescription
string *

classes

Return:

string[]

public content(): Array source

Get the post's content.

Return:

Array

public elementAttrs(): Object source

Get attributes for the post element.

Return:

Object

public footerItems(): ItemList source

Build an item list for the post's footer.

Return:

ItemList

public onbeforeupdate(vnode: *): * source

Params:

NameTypeAttributeDescription
vnode *

Return:

*

public oninit(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public onupdate(vnode: *) source

Params:

NameTypeAttributeDescription
vnode *

public view(): * source

Return:

*