Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nuxtjs/router

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxtjs/router

Nuxt module to use router.js instead of pages/ directory

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
increased by4.18%
Maintainers
1
Weekly downloads
 
Created
Source

Nuxt Router Module

npm (scoped with tag) npm CircleCI Codecov Dependencies

js-standard-style

Nuxt module to use router.js instead of pages/ directory

📖 Release Notes

Features

The module features

Setup

  1. Install @nuxtjs/router dependency with yarn or npm into your project
  2. Add @nuxtjs/router to modules section of nuxt.config.js:
{
  modules: [
    '@nuxtjs/router'
 ]
}

Usage

This module disable the pages/ directory into Nuxt and will use a router.js file at your srcDir directory:

components/
  my-page.vue
router.js

router.js need to export a createRouter method like this:

import Vue from 'vue'
import Router from 'vue-router'

import MyPage from '~/components/my-page'

Vue.use(Router)

export function createRouter() {
  return new Router({
    mode: 'history',
    routes: [
      {
        path: '/',
        component: MyPage
      }
    ]
  })
}

License

MIT License

Copyright (c) Sebastien Chopin seb@chopin.io

FAQs

Package last updated on 08 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc