Reference Source
import DefaultResolver from 'flarum/common/resolvers/DefaultResolver'
public class | source

DefaultResolver

Generates a route resolver for a given component. In addition to regular route resolver functionality:

  • It provide the current route name as an attr
  • It sets a key on the component so a rerender will be triggered on route change.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

makeAttrs(vnode: undefined): {...undefined: Object, "routeName": *}

public

makeKey(): *

When a route change results in a changed key, a full page rerender occurs.

public

onmatch(args: undefined, requestedPath: undefined, route: undefined): *

public

Public Constructors

public constructor() source

Public Members

public component: * source

public routeName: * source

Public Methods

public makeAttrs(vnode: undefined): {...undefined: Object, "routeName": *} source

Params:

NameTypeAttributeDescription
vnode undefined

Return:

{...undefined: Object, "routeName": *}

public makeKey(): * source

When a route change results in a changed key, a full page rerender occurs. This method can be overriden in subclasses to prevent rerenders on some route changes.

Return:

*

public onmatch(args: undefined, requestedPath: undefined, route: undefined): * source

Params:

NameTypeAttributeDescription
args undefined
requestedPath undefined
route undefined

Return:

*

public render(vnode: undefined): undefined[] source

Params:

NameTypeAttributeDescription
vnode undefined

Return:

undefined[]