1 line
6.6 KiB
JSON
1 line
6.6 KiB
JSON
{"remainingRequest":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\phpstudy_pro\\WWW\\travel\\admin\\src\\layout\\components\\Sidebar\\SidebarItem.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\src\\layout\\components\\Sidebar\\SidebarItem.vue","mtime":1718070786026},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1718764957200},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\babel-loader\\lib\\index.js","mtime":1718764959024},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1718764957200},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\vue-loader\\lib\\index.js","mtime":1718764959862}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:Ly8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KDQppbXBvcnQgcGF0aCBmcm9tICdwYXRoJw0KaW1wb3J0IHsgaXNFeHRlcm5hbCB9IGZyb20gJ0AvdXRpbHMvdmFsaWRhdGUnDQppbXBvcnQgSXRlbSBmcm9tICcuL0l0ZW0nDQppbXBvcnQgQXBwTGluayBmcm9tICcuL0xpbmsnDQppbXBvcnQgRml4aU9TQnVnIGZyb20gJy4vRml4aU9TQnVnJw0KDQpleHBvcnQgZGVmYXVsdCB7DQogIG5hbWU6ICdTaWRlYmFySXRlbScsDQogIGNvbXBvbmVudHM6IHsgSXRlbSwgQXBwTGluayB9LA0KICBtaXhpbnM6IFtGaXhpT1NCdWddLA0KICBwcm9wczogew0KICAgIC8vIHJvdXRlIG9iamVjdA0KICAgIGl0ZW06IHsNC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bi5sZW5ndGggPT09IDEpIHsNCiAgICAgICAgcmV0dXJuIHRydWUNCiAgICAgIH0NCg0KICAgICAgLy8gU2hvdyBwYXJlbnQgaWYgdGhlcmUgYXJlIG5vIGNoaWxkIHJvdXRlciB0byBkaXNwbGF5DQogICAgICBpZiAoc2hvd2luZ0NoaWxkcmVuLmxlbmd0aCA9PT0gMCkgew0KICAgICAgICB0aGlzLm9ubHlPbmVDaGlsZCA9IHsgLi4uIHBhcmVudCwgcGF0aDogJycsIG5vU2hvd2luZ0NoaWxkcmVuOiB0cnVlIH0NCiAgICAgICAgcmV0dXJuIHRydWUNCiAgICAgIH0NCg0KICAgICAgcmV0dXJuIGZhbHNlDQogICAgfSwNCiAgICByZXNvbHZlUGF0aChyb3V0ZVBhdGgpIHsNCiAgICAgIGlmIChpc0V4dGVybmFsKHJvdXRlUGF0aCkpIHsNCiAgICAgICAgcmV0dXJuIHJvdXRlUGF0aA0KICAgICAgfQ0KICAgICAgaWYgKGlzRXh0ZXJuYWwodGhpcy5iYXNlUGF0aCkpIHsNCiAgICAgICAgcmV0dXJuIHRoaXMuYmFzZVBhdGgNCiAgICAgIH0NCiAgICAgIHJldHVybiBwYXRoLnJlc29sdmUodGhpcy5iYXNlUGF0aCwgcm91dGVQYXRoKQ0KICAgIH0NCiAgfQ0KfQ0K"},{"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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;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)\">\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 // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237\r\n // TODO: refactor with render function\r\n this.onlyOneChild = null\r\n return {}\r\n },\r\n methods: {\r\n hasOneShowingChild(children = [], parent) {\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) {\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 return path.resolve(this.basePath, routePath)\r\n }\r\n }\r\n}\r\n</script>\r\n"]}]} |