Bitsmist Frameworks
Docs ยป Router

Router

Inherit:Component

Overview

The Router is a router component for the BitsmistJS framework. The router is enabled by placing a <bm-router> tag in the HTML.

Since the Route class inherits the Component class, its routing settings can be set in the same way as for normal component settings. Put settings in an external file and specify the URL to the file as the router's tag attribute or inherit Route class and override _getSettings() function to return the settings.

See below for details on how to configure settings.

  • BitsmistJS Core - Component - Settings - Specifying settings

The router itself has almost no functionality, and most of the functionality is performed by the organizer attached to the router. The router only calls the switchSpec() method on the doStart event to read the spec file, and the openRoute() method on the afterStart event to start the drawing process for that page. Both methods, switchSpec() and openRoute(), are implemented by the organizer.

The Router attaches organizers below by default.

  • RouteOrganizer
Previous Next

© 2019-2023 Masaki Yasutake

Bitsmist Frameworks

Table of Contents

GENERAL

  • Overview
  • Installation

REFERENCE - COMPONENT

  • Router

REFERENCE - ORGANIZER

  • RouteOrganizer