@axelspringer/mango-router

Mango router
8,066
Install
npm install @axelspringer/mango-router@0.12.3
Latest Version:0.12.3
License:MIT
Last Updated:Sep 26, 2018
Links: npm
Maintainer: andreasprang

:smiley_cat: Mango Router


Taylor Swift Volkswagen TypeScript MIT license

Getting Started

requires a node version >= 6 and an npm version >= 3.x.x

we do provide a help command to display all possible arguments

# Install the base package and the plugin (could also be global -g)
npm i @axelspringer/mango-router

Usage

Create a router.ts file with the following content.

import Vue from 'vue'
import Router from 'vue-router'
import { Home } from '../components/home'
import { Post } from '../components/post'
import MangoRouter from '@axelspringer/mango-router'

MangoRouter // build the route
  .home(Home)
  .post(Post)

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: MangoRouter.all()
})

This configures the vue-router under the hood to match / to the Home component and /:post to the Post component. The partial paths of the route are constructed by chaining the routes.

License

MIT

Related Packages

@axelspringer/mango-head

Mango Head

15,231
@axelspringer/mango-pagemanager

Mango Page Manager

7,694

Version History

Version Released License
0.12.3 MIT
0.12.2 MIT
0.12.1 MIT
0.12.0 MIT
0.8.2 MIT
Pre-releases (187)
Version Released Vue License
1.1.0-9 ^2.5.16 MIT
1.1.0-8 ^2.5.16 MIT
1.1.0-7 ^2.5.16 MIT
1.1.0-6 ^2.5.16 MIT
1.1.0-5 ^2.5.16 MIT