vue-macula-auto-routing
Generate Vue Router routing automatically for multipage
Last updated a year ago by rainsoft .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vue-macula-auto-routing 
SYNC missed versions from official npm registry.

vue-macula-auto-routing

Generate Vue Router routing automatically for multipages.

forked from ktsn/vue-auto-routing

You may want to use vue-cli-plugin-macula-auto-routing which includes all useful features on routing.

Installation

$ npm install -D vue-macula-auto-routing

Usage

vue-macula-auto-routing resolves Vue Router routing automatically by using vue-macula-auto-routing. The routes are generated with the same rules with Nuxt routing.

To use this, you import vue-macula-auto-routing and pass it into Vue Router constructor options.

// Import generated routes
import routes from './routes'

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

Vue.use(Router)

export default new Router({
  // Pass the generated routes into the routes option
  routes
})

You also need to add a webpack plugin vue-macula-auto-routing provides. The plugin options are the same as vue-macula-auto-routing options

// webpack.config.js

const VueAutoRoutingPlugin = require('vue-macula-auto-routing/lib/webpack-plugin')

module.exports = {
  // ... other options ...

  plugins: [
    new VueAutoRoutingPlugin({
      // Path to the directory that contains your multi pages and page components.
      pages: 'src/modules',

      // A string that will be added to importing component path (default src/modules/).
      importPrefix: 'src/modules/'
    })
  ]
}

Related Projects

License

MIT

Current Tags

  • 0.3.6                                ...           latest (a year ago)

6 Versions

  • 0.3.6                                ...           a year ago
  • 0.3.5                                ...           2 years ago
  • 0.3.4                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 3
Last Month 8
Dependencies (1)
Dev Dependencies (16)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |