mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2026-05-15 00:00:02 +08:00
10 lines
331 B
JavaScript
10 lines
331 B
JavaScript
import { defineAsyncComponent } from 'vue'
|
|
|
|
const components = import.meta.glob('./**/*.vue')
|
|
export default function install (app) {
|
|
for (const [key, value] of Object.entries(components)) {
|
|
const name = key.substring(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
|
|
app.component(name, defineAsyncComponent(value))
|
|
}
|
|
}
|