nuxt-router-extras

Extra Add-ons For Nuxt Router

This module has been renamed to @nuxtjs/router-extras, please install the latest version of @nuxtjs/router-extras
Last updated 2 years ago by farnabaz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nuxt-router-extras 
SYNC missed versions from official npm registry.

nuxt-router-extras

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

???? Release Notes

Features

nuxt-router-extras can:

  • define custom paths for page
  • specify multiple paths to single page
  • define multiple params regardless of pages directory structure

Setup

  • Add nuxt-router-extras dependency using yarn or npm to your project
  • Add nuxt-router-extras to modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'nuxt-router-extras',

    // With options
    ['nuxt-router-extras', { /* module options */ }],
 ]
}

Usage

  • define custom paths for page

    Simply add a block inside vue file and define path in yaml

    <router>
        path: /posts
    </router>
    
  • specify multiple paths to single page

    If you want more paths for a single page, define them with aliases

    <router>
        path: /posts
        alias:
          - /articles
          - /blog
    </router>
    
  • define multiple params regardless of pages directory structure

    <router>
        path: /post/:id/:title?
    </router>
    

Syntax Highlighting

Visual Studio Code

Install Vetur extension and define custom block

  • Add <router> to vetur.grammar.customBlocks in VSCode settings
    "vetur.grammar.customBlocks": {
        "docs": "md",
        "i18n": "json",
        "router": "yaml"
    }
    
  • Execute command > Vetur: Generate grammar from vetur.grammar.customBlocks in VSCode
  • Restart VSCode and enjoy awesome

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Start development server using npm run dev

License

MIT License

Copyright (c)

Current Tags

  • 0.0.3                                ...           latest (2 years ago)

3 Versions

  • 0.0.3 [deprecated]           ...           2 years ago
  • 0.0.2 [deprecated]           ...           2 years ago
  • 0.0.1 [deprecated]           ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |