UNPKG

sdno-log-view

Version:

A plugin with multiple components using ElementPlus

42 lines (36 loc) 1.48 kB
// 详情 import DetailDialog from "./components/DetailDialog.vue"; // 流程图 弹窗 import FlowChart from "./components/FlowChart.vue"; // 北向日志 import NorthModule from "./components/NorthModule.vue"; // // 南向日志 import SouthModule from "./components/SouthModule.vue"; // // 操作日志 // import OperationModule from "./components/OperationModule.vue"; // // 流程日志 // import ProcessModule from "./components/ProcessModule.vue"; import blueRightIcon from "./assets/blue-right-icon.png"; import greenRightIcon from "./assets/green-right-icon.png"; import redRightIcon from "./assets/red-right-icon.png"; // 只包含实际的组件,并为每个组件指定默认名称 const components = [ { component: DetailDialog, defaultName: "DetailDialog" }, { component: FlowChart, defaultName: "FlowChart" }, { component: NorthModule, defaultName: "NorthModule" }, { component: SouthModule, defaultName: "SouthModule" }, ]; const install = (app) => { components.forEach(({ component, defaultName }) => { const componentName = component.name || component.__name || defaultName; if (componentName) { app.component(componentName, component); } else { console.warn(`组件注册失败:无法确定组件名称`, component); } }); }; // 导出资源 export { DetailDialog, FlowChart, NorthModule, SouthModule, blueRightIcon, greenRightIcon, redRightIcon }; // 导出插件 export default install;