11 lines
328 B
JavaScript
11 lines
328 B
JavaScript
|
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));
|
||
|
});
|
||
|
}
|