adrema/resources/js/lib/requireModules.js

11 lines
328 B
JavaScript
Raw Normal View History

2023-05-19 01:06:46 +02:00
import {paramCase} from 'change-case';
export default function (context, Vue, prefix) {
context.keys().forEach((file) => {
let componentName = paramCase(`${prefix}${file.replace(/^\.\/(.*?)\.vue$/g, '$1')}`);
console.log(componentName);
Vue.component(componentName, () => context(file));
});
}