前端最新版本同步
This commit is contained in:
17
openhis-ui-vue3/src/template/index.js
Normal file
17
openhis-ui-vue3/src/template/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// 动态引入 template 目录下的所有 .vue 文件
|
||||
const templates = import.meta.glob('./*.vue', { eager: true });
|
||||
|
||||
const components = [];
|
||||
|
||||
// 遍历所有引入的文件
|
||||
for (const path in templates) {
|
||||
const component = templates[path].default;
|
||||
components.push(component);
|
||||
}
|
||||
const registerComponents = (app) => {
|
||||
components.forEach((component) => {
|
||||
app.component(component.name, component);
|
||||
})
|
||||
}
|
||||
export { components, registerComponents };
|
||||
|
||||
Reference in New Issue
Block a user