From 5e7dd348c81c8be48f8ac372e4d033637c2b8a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20J=C3=BCrisoo?= Date: Tue, 27 Nov 2018 07:57:21 +0800 Subject: [PATCH] Automatic component registering As added to latest laravel versions --- src/stubs/app.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/stubs/app.js b/src/stubs/app.js index 98eca79..233a8fa 100644 --- a/src/stubs/app.js +++ b/src/stubs/app.js @@ -17,6 +17,17 @@ window.Vue = require('vue'); Vue.component('example-component', require('./components/ExampleComponent.vue')); +/** + * The following block of code may be used to automatically register your + * Vue components. It will recursively scan this directory for the Vue + * components and automatically register them with their "basename". + * + * Eg. ./components/ExampleComponent.vue -> + */ + +// const files = require.context('./', true, /\.vue$/i) +// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key))) + const app = new Vue({ el: '#app' });