Vue Auto Routing

A quick Laravel Mix extension to generate Vue Router routing automatically.
latest v0.1.2 - released
kabbouchi
8 downloads last week
MIT license
3 versions
vue
routing
vue router

Laravel Mix - Vue Auto Routing

This extension generate Vue Router routing automatically.

Usage

First, install the extension.

npm install laravel-mix-vue-auto-routing --save-dev
npm install vue-router --save

Then, require it within your webpack.mix.js file, like so:

let mix = require('laravel-mix');

require('laravel-mix-vue-auto-routing');

mix
    .js('resources/js/app.js', 'public/js')
    .vueAutoRouting();
// /resources/js/router/index.js
import routes from 'vue-auto-routing'

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

Vue.use(Router)

export default new Router({
    routes,
    mode: 'history',
    base: '/',
})
resources/
    js/
    └── pages/
        ├── index.vue
        ├── users.vue
        └── users/
            └── _id.vue