Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run
12 lines
380 B
JavaScript
12 lines
380 B
JavaScript
import { defineAsyncComponent } from 'vue'
|
|
|
|
export function setComponents(app) {
|
|
// 动态导出当前目录下的组件
|
|
const modules = import.meta.glob(['./*.vue', './system/*.vue'])
|
|
|
|
for (const [key, value] of Object.entries(modules)) {
|
|
const name = key.slice(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
|
|
app.component(name, defineAsyncComponent(value))
|
|
}
|
|
}
|