Skip to content

A quick Laravel Mix extension to generate "Vue Router" routing automatically.

Notifications You must be signed in to change notification settings

KABBOUCHI/laravel-mix-vue-auto-routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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

About

A quick Laravel Mix extension to generate "Vue Router" routing automatically.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published