chat-app/src/components/talk/message/index.js
caiyx 2464c15603
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
fix
2024-11-22 09:06:37 +08:00

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))
}
}