Skip to content

Instantly share code, notes, and snippets.

View yaman3bd's full-sized avatar

Yaman Abd yaman3bd

View GitHub Profile
@yaman3bd
yaman3bd / app.js
Last active April 18, 2021 12:10
Auto register Vue3 components
//in your app.js add this:
window.Vue = require('vue');
const app = Vue.createApp({});
const files = require.context('./', true, /\.vue$/i);
files.keys().map(function (key) {
app.component(key.split('/').pop().split('.')[0], files(key).default);
});