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

LinkButton

Extends:

src/common/Component.js~ComponentButton → LinkButton

Direct Subclass:

AdminLinkButton

The LinkButton component defines a Button which links to a route.

Attrs

All of the attrs accepted by Button, plus:

  • active Whether or not the page that this button links to is currently active.
  • href The URL to link to. If the current URL m.route() matches this, the active prop will automatically be set to true.
  • force Whether the page should be fully rerendered. Defaults to true.

Static Method Summary

Static Public Methods
public static

initAttrs(attrs: *)

public static

Determine whether a component with the given attrs is 'active'.

Method Summary

Public Methods
public

view(vnode: *): *

Inherited Summary

From class Button
public

view(vnode: *): *

protected

getButtonContent(children: *): *

Get the template for the button's content.

Static Public Methods

public static initAttrs(attrs: *) source

Params:

NameTypeAttributeDescription
attrs *

public static isActive(attrs: Object): Boolean source

Determine whether a component with the given attrs is 'active'.

Params:

NameTypeAttributeDescription
attrs Object

Return:

Boolean

Public Methods

public view(vnode: *): * source

Override:

Button#view

Params:

NameTypeAttributeDescription
vnode *

Return:

*