car_web/node_modules/.cache/vue-loader/984484352493710529b0ed62d26...

1 line
6.8 KiB
JSON

{"remainingRequest":"D:\\workspace\\car_web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\workspace\\car_web\\src\\layout\\components\\Sidebar\\SidebarItem.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\workspace\\car_web\\src\\layout\\components\\Sidebar\\SidebarItem.vue","mtime":1708672711891},{"path":"D:\\workspace\\car_web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\workspace\\car_web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\workspace\\car_web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\workspace\\car_web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:Ly8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KDQppbXBvcnQgcGF0aCBmcm9tICdwYXRoJw0KaW1wb3J0IHsgaXNFeHRlcm5hbCB9IGZyb20gJ0AvdXRpbHMvdmFsaWRhdGUnDQppbXBvcnQgSXRlbSBmcm9tICcuL0l0ZW0nDQppbXBvcnQgQXBwTGluayBmcm9tICcuL0xpbmsnDQppbXBvcnQgRml4aU9TQnVnIGZyb20gJy4vRml4aU9TQnVnJw0KDQpleHBvcnQgZGVmYXVsdCB7DQogIG5hbWU6ICdTaWRlYmFySXRlbScsDQogIGNvbXBvbmVudHM6IHsgSXRlbSwgQXBwTGluayB9LA0KICBtaXhpbnM6IFtGaXhpT1NCdWddLA0KICBwcm9wczogew0KICAgIC8vIHJvdXRlIG9iamVjdA0KICAgIGl0ZW06IHsNCiAgICAgIHR5cGU6IE9iamVjdCwNCiAgICAgIHJlcXVpcmVkOiB0cnVlDQogICAgfSwNCiAgICBpc05lc3Q6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5sZW5ndGggPT09IDApIHsNCiAgICAgICAgdGhpcy5vbmx5T25lQ2hpbGQgPSB7IC4uLiBwYXJlbnQsIHBhdGg6ICcnLCBub1Nob3dpbmdDaGlsZHJlbjogdHJ1ZSB9DQogICAgICAgIHJldHVybiB0cnVlDQogICAgICB9DQoNCiAgICAgIHJldHVybiBmYWxzZQ0KICAgIH0sDQogICAgcmVzb2x2ZVBhdGgocm91dGVQYXRoLCByb3V0ZVF1ZXJ5KSB7DQogICAgICBpZiAoaXNFeHRlcm5hbChyb3V0ZVBhdGgpKSB7DQogICAgICAgIHJldHVybiByb3V0ZVBhdGgNCiAgICAgIH0NCiAgICAgIGlmIChpc0V4dGVybmFsKHRoaXMuYmFzZVBhdGgpKSB7DQogICAgICAgIHJldHVybiB0aGlzLmJhc2VQYXRoDQogICAgICB9DQogICAgICBpZiAocm91dGVRdWVyeSkgew0KICAgICAgICBsZXQgcXVlcnkgPSBKU09OLnBhcnNlKHJvdXRlUXVlcnkpOw0KICAgICAgICByZXR1cm4geyBwYXRoOiBwYXRoLnJlc29sdmUodGhpcy5iYXNlUGF0aCwgcm91dGVQYXRoKSwgcXVlcnk6IHF1ZXJ5IH0NCiAgICAgIH0NCiAgICAgIHJldHVybiBwYXRoLnJlc29sdmUodGhpcy5iYXNlUGF0aCwgcm91dGVQYXRoKQ0KICAgIH0NCiAgfQ0KfQ0K"},{"version":3,"sources":["SidebarItem.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"SidebarItem.vue","sourceRoot":"src/layout/components/Sidebar","sourcesContent":["<template>\r\n <div v-if=\"!item.hidden\">\r\n <template v-if=\"hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow\">\r\n <app-link v-if=\"onlyOneChild.meta\" :to=\"resolvePath(onlyOneChild.path, onlyOneChild.query)\">\r\n <el-menu-item :index=\"resolvePath(onlyOneChild.path)\" :class=\"{'submenu-title-noDropdown':!isNest}\">\r\n <item :icon=\"onlyOneChild.meta.icon||(item.meta&&item.meta.icon)\" :title=\"onlyOneChild.meta.title\" />\r\n </el-menu-item>\r\n </app-link>\r\n </template>\r\n\r\n <el-submenu v-else ref=\"subMenu\" :index=\"resolvePath(item.path)\" popper-append-to-body>\r\n <template slot=\"title\">\r\n <item v-if=\"item.meta\" :icon=\"item.meta && item.meta.icon\" :title=\"item.meta.title\" />\r\n </template>\r\n <sidebar-item\r\n v-for=\"child in item.children\"\r\n :key=\"child.path\"\r\n :is-nest=\"true\"\r\n :item=\"child\"\r\n :base-path=\"resolvePath(child.path)\"\r\n class=\"nest-menu\"\r\n />\r\n </el-submenu>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport path from 'path'\r\nimport { isExternal } from '@/utils/validate'\r\nimport Item from './Item'\r\nimport AppLink from './Link'\r\nimport FixiOSBug from './FixiOSBug'\r\n\r\nexport default {\r\n name: 'SidebarItem',\r\n components: { Item, AppLink },\r\n mixins: [FixiOSBug],\r\n props: {\r\n // route object\r\n item: {\r\n type: Object,\r\n required: true\r\n },\r\n isNest: {\r\n type: Boolean,\r\n default: false\r\n },\r\n basePath: {\r\n type: String,\r\n default: ''\r\n }\r\n },\r\n data() {\r\n this.onlyOneChild = null\r\n return {}\r\n },\r\n methods: {\r\n hasOneShowingChild(children = [], parent) {\r\n if (!children) {\r\n children = [];\r\n }\r\n const showingChildren = children.filter(item => {\r\n if (item.hidden) {\r\n return false\r\n } else {\r\n // Temp set(will be used if only has one showing child)\r\n this.onlyOneChild = item\r\n return true\r\n }\r\n })\r\n\r\n // When there is only one child router, the child router is displayed by default\r\n if (showingChildren.length === 1) {\r\n return true\r\n }\r\n\r\n // Show parent if there are no child router to display\r\n if (showingChildren.length === 0) {\r\n this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }\r\n return true\r\n }\r\n\r\n return false\r\n },\r\n resolvePath(routePath, routeQuery) {\r\n if (isExternal(routePath)) {\r\n return routePath\r\n }\r\n if (isExternal(this.basePath)) {\r\n return this.basePath\r\n }\r\n if (routeQuery) {\r\n let query = JSON.parse(routeQuery);\r\n return { path: path.resolve(this.basePath, routePath), query: query }\r\n }\r\n return path.resolve(this.basePath, routePath)\r\n }\r\n }\r\n}\r\n</script>\r\n"]}]}