1.0.3 • Published 6 years ago

vue-page-router v1.0.3

Weekly downloads
8
License
MIT
Repository
-
Last release
6 years ago

Vue Page Router

Nuxt-inspired route management

GitHub * NPM

Given:

router.js
pages/
  index.vue
  example.vue
  help.vue
  about.vue

router.js Before:

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Index',
      component: () => import('./pages/index.vue'),
    },
    {
      path: '/example',
      name: 'Example',
      component: () => import('./pages/example.vue'),
    },
    {
      path: '/help',
      name: 'Help',
      component: () => import('./pages/help.vue'),
    },
    {
      path: '/about',
      name: 'About',
      component: () => import('./pages/about.vue'),
    },
  ],
})

router.js After:

import Vue from 'vue'
import PageRouter from 'vue-page-router'
import * as pages from './pages'
export default PageRouter.install(Vue, pages)

Getting Started

npm install --save vue-page-router

In the same directory as package.json, make a .babelrc config file with these contents:

{
  "plugins": [
    ["wildcard", { "exts": ["js", "es6", "es", "jsx", "vue"]}]
  ]
}

Dev Setup

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.1.6

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.0.0

7 years ago