This package has been deprecated

Author message:

This module has been renamed to @nuxtjs/router-extras, please install the latest version of @nuxtjs/router-extras

nuxt-router-extras

0.0.3 • Public • Published

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)

Readme

Keywords

none

Package Sidebar

Install

npm i nuxt-router-extras

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

9.03 kB

Total Files

6

Last publish

Collaborators

  • farnabaz
  • pi0