14 lines
410 B
JavaScript
14 lines
410 B
JavaScript
// src/boot/global-components.js
|
|
import { defineAsyncComponent } from 'vue';
|
|
|
|
const components = import.meta.glob('src/components/**/*.vue');
|
|
export default ({ app }) => {
|
|
for (const path in components) {
|
|
const componentName = path
|
|
.split('/')
|
|
.pop()
|
|
.replace(/\.\w+$/, '');
|
|
app.component(componentName, defineAsyncComponent(components[path]));
|
|
}
|
|
};
|