{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/layout/components/Sidebar/SidebarItem.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/layout/components/Sidebar/SidebarItem.vue","mtime":1701742078549},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n// +----------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]\n// +----------------------------------------------------------------------\n// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.\n// +----------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权\n// +----------------------------------------------------------------------\n// | Author: CRMEB Team <admin@crmeb.com>\n// +----------------------------------------------------------------------\n\nimport path from 'path';\nimport { isExternal } from '@/utils/validate';\nimport Item from './Item';\nimport AppLink from './Link';\nimport FixiOSBug from './FixiOSBug';\n\nexport default {\n  name: 'SidebarItem',\n  components: { Item, AppLink },\n  mixins: [FixiOSBug],\n  props: {\n    // route object\n    item: {\n      type: Object,\n      required: true,\n    },\n    isNest: {\n      type: Boolean,\n      default: false,\n    },\n    basePath: {\n      type: String,\n      default: '',\n    },\n  },\n  data() {\n    // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237\n    // TODO: refactor with render function\n    this.onlyOneChild = null;\n    return {};\n  },\n  methods: {\n    hasOneShowingChild(child = [], parent) {\n      const showingChildren = child.filter((item) => {\n        if (item.hidden) {\n          return false;\n        } else {\n          // Temp set(will be used if only has one showing child)\n          this.onlyOneChild = item;\n          return true;\n        }\n      });\n\n      // When there is only one child router, the child router is displayed by default\n      if (showingChildren.length === 1) {\n        return true;\n      }\n\n      // Show parent if there are no child router to display\n      if (showingChildren.length === 0) {\n        this.onlyOneChild = { ...parent, path: '', noShowingChildren: true };\n        return true;\n      }\n\n      return false;\n    },\n    resolvePath(routePath) {\n      if (isExternal(routePath)) {\n        return routePath;\n      }\n      if (isExternal(this.basePath)) {\n        return this.basePath;\n      }\n      return path.resolve(this.basePath, routePath);\n    },\n  },\n};\n",null]}