multirouter
v1.1.6
Published
A flexible multirouter for routing all your components at once
Downloads
2
Maintainers
Readme
Multirouter.js
A flexible multirouter for routing all your components at once.
Demo
Visit: https://edealer.nl/multirouter/
Installation
With script tag:
<script src="multirouter.js"></script>
With npm:
$ npm install multirouter
{
"dependencies": {
"multirouter": ">= 1.1.x"
}
}
Usage
Start the router:
Multirouter.start();
Route used as a flag:
url: /flag
router.route("flag", function (flag) {
console.log(flag === false ? "flag disabled" : "flag enabled");
});
> "flag enabled"
router.navigate("flag", false);
url: /
> "flag disabled"
Route used with multiple parameters:
url: /range:1:2
router.route("page", function (params) {
console.log(params);
});
> [1, 2]
router.navigate("page", [4, 5]);
url: /range:4:5
> [4, 5]
Options
See start()
, route()
, navigate()
.
License and copyright
Licensed under the BSD (Berkeley Software Distribution) License. Copyright (c) 2014, Rick Wong. All rights reserved.