UNPKG

jj-module-document

Version:

文档管理模块

19 lines (17 loc) 630 B
// 前端模块对外公开函数类 /** * 获取当前模块的菜单组件. 使用于store/modules/instrument.js * @param {*} moduleComponent 原样返回.当没有匹配到数据时 * @param {*} tmpModule 模块 * @param {*} tmpComponent 组件路径 * @returns */ export function getMenuComponent(moduleComponent, tmpModule, tmpComponentPath) { const splitArr = tmpComponentPath.split("/"); if (splitArr && splitArr.length > 0) { if (tmpComponentPath.toLocaleLowerCase().includes("moduledocument")) { return tmpModule[splitArr[splitArr.length - 1]] } } return moduleComponent; }