From bdbef0fbde20317d19bfc6d3473dabb10fb3fb3b Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Sat, 19 Apr 2025 15:41:21 +0800
Subject: [PATCH] feat: 修改任务事件概况的饼状图颜色
---
src/components/index.js | 33 +++++++++++++--------------------
1 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/src/components/index.js b/src/components/index.js
index 3101eb5..7d7a74c 100644
--- a/src/components/index.js
+++ b/src/components/index.js
@@ -1,22 +1,15 @@
-/*
- * @Author: shuishen 1109946754@qq.com
- * @Date: 2024-10-25 15:20:05
- * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-08 20:11:39
- * @FilePath: \bigScreen\src\components\index.js
- * @Description:
- *
- * Copyright (c) 2024 by shuishen, All Rights Reserved.
- */
-/*
- **全局注册组件
- ** 放在components/global文件夹下
- */
import { defineAsyncComponent } from 'vue'
-const components = import.meta.glob('./global/*.vue') // 异步方式
-export default function install (app) {
- for (const [key, value] of Object.entries(components)) {
- const name = key.slice(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
- app.component(name, defineAsyncComponent(value))
- }
+
+export default {
+ install(app) {
+ // 匹配当前目录下所有.vue文件(包括子目录)
+ const components = import.meta.glob('./global/*.vue', { eager: true })
+
+ for (const [path, module] of Object.entries(components)) {
+ // 提取组件名(去除路径和扩展名)
+ const name = path.split('/').pop()?.replace('.vue', '') || ''
+ // 注册组件
+ app.component(name, module.default)
+ }
+ },
}
--
Gitblit v1.9.3