# vue-macula-auto-routing

> Generate Vue Router routing automatically for multipage

Latest version **0.3.6** (published 2018-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-macula-auto-routing
pnpm add vue-macula-auto-routing
yarn add vue-macula-auto-routing
bun add vue-macula-auto-routing
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.6 |
| Published | 2018-12-08 |
| First published | 2018-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | katashin, rain |
| Maintainers | rainsoft |
| Keywords | Vue, Vue Router, routing, auto generate, generator, webpack, plugin |

## Links

- npm: https://www.npmjs.com/package/vue-macula-auto-routing
- Repository: https://github.com/macula-projects/vue-macula-auto-routing
- Issues: https://github.com/macula-projects/vue-macula-auto-routing/issues
- npm.io page: https://npm.io/package/vue-macula-auto-routing

## Dependencies (1)

- [vue-macula-route-generator](https://npm.io/package/vue-macula-route-generator.md) ^0.3.4

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 0.3.6 (latest) — 2018-12-08
- 0.3.5 — 2018-10-23
- 0.3.4 — 2018-10-19
- 0.3.3 — 2018-10-19
- 0.3.2 — 2018-10-19
- 0.3.1 — 2018-10-18

## README

# 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](https://github.com/macula-projects/vue-cli-plugin-macula-auto-routing) which includes all useful features on routing.

## Installation

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

## Usage

vue-macula-auto-routing resolves Vue Router routing automatically by using [vue-macula-auto-routing](https://github.com/macula-projects/vue-macula-auto-routing). The routes are generated with the same rules with [Nuxt routing](https://nuxtjs.org/guide/routing).

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

```js
// 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](https://github.com/macula-projects/vue-macula-auto-routing#references)

```js
// 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

* [vue-cli-plugin-macula-auto-routing](https://github.com/macula-projects/vue-cli-plugin-macula-auto-routing): Vue CLI plugin including auto multi pages and layouts resolution.
* [vue-router-layout](https://github.com/ktsn/vue-router-layout): Lightweight layout resolver for Vue Router.
* [vue-macula-route-generator](https://github.com/macula-projects/vue-macula-route-generator): Low-level utility generating routing which vue-macula-auto-routing using under the hood.

## License

MIT

---
_Source: https://npm.io/package/vue-macula-auto-routing · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
