Git Product home page Git Product logo

vue-macula-auto-routing's Introduction

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

vue-macula-auto-routing's People

Contributors

ktsn avatar rainsoft avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.