// 批量引入所有封装的子组件 component下组件为封装的公共组件 component下项目路径文件夹下的组件为定制化组件 const AllComponents = import.meta.globEager("./component/*.vue"); let res_components = {}; console.log(AllComponents); Object.keys(AllComponents).forEach((item) => { console.log(item); let comp = AllComponents[item]; let name = comp.default.name; res_components[name] = comp.default; }); const config = { ComparisonTable: [ { title: '综合分析', content: markRaw(res_components['ZhongheFenXi']), name: "zhfx" }, { title: '数据异常分析', content: markRaw(res_components['ShuJuYiChangFenXi']), name: "sjycfx" }, { title: '运维派单', content: markRaw(res_components['ZhanDianYunWeiPaiDan']), name: "zdywpd" }, { title: '故障及离线设备分析', content: markRaw(res_components['GuZhangJiLiXianSheBeiFenXi']), name: "gzjlxsbfx" }, { title: '详细信息', content: markRaw(res_components['XiangXiXinXi']), name: "xxxx" }, { title: '进度分析', content: markRaw(res_components['JindDuFenXi']), name: "jdfx" }, { title: '资金分析', content: markRaw(res_components['ZiJinFenXi']), name: "zjfx" }, { title: '建设对比', content: markRaw(res_components['JianSheDuiBi']), name: "jsdb" }, { title: '工程考核', content: markRaw(res_components['GongChenKaoHe']), name: "gckh" }, { title: '质量风险', content: markRaw(res_components['ZhiLiangFengXian']), name: "zlfengxian" }, { title: '安全风险', content: markRaw(res_components['AnQuanFengXian']), name: "aqfengxian" }, { title: '项目巡查', content: markRaw(res_components['XiangMuXunCa']), name: "xmxc" }, { title: '项目资料', content: markRaw(res_components['XiangMuZiLiao']), name: "xmzl" }, { title: '视频监控', content: markRaw(res_components['ShiPingJianKong']), name: "spjk" } ] } export default config;