73a3e7894a213d76cad91d59efbd3c52.json 4.2 KB

1
  1. {"remainingRequest":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/src/components/Breadcrumb/index.vue?vue&type=style&index=0&id=b50ef614&lang=scss&scoped=true","dependencies":[{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/src/components/Breadcrumb/index.vue","mtime":1708395041799},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/css-loader/dist/cjs.js","mtime":1708395146948},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":1708395147772},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/postcss-loader/src/index.js","mtime":1708395147225},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/sass-loader/dist/cjs.js","mtime":1708395146389},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/cache-loader/dist/cjs.js","mtime":1708395146433},{"path":"/Users/caoge/Desktop/地质现场/VehicleMonitor-WEB/node_modules/vue-loader/lib/index.js","mtime":1708395147382}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCi5hcHAtYnJlYWRjcnVtYi5lbC1icmVhZGNydW1iIHsKICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CiAgd2lkdGg6IDEwMCU7CiAgZm9udC1zaXplOiAxNHB4OwogIGxpbmUtaGVpZ2h0OiA0MHB4OwogIHBhZGRpbmctbGVmdDogOHB4OwogIGJhY2tncm91bmQtY29sb3I6IHJnYigyNDUsIDI0NSwgMjQ1KTsKCiAgLm5vLXJlZGlyZWN0IHsKICAgIGNvbG9yOiAjMjc2NmRkOwogICAgY3Vyc29yOiB0ZXh0OwogIH0KfQo="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkFA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/components/Breadcrumb","sourcesContent":["<template>\n <el-breadcrumb class=\"app-breadcrumb\" separator=\"/\">\n <transition-group name=\"breadcrumb\">\n <el-breadcrumb-item v-for=\"(item, index) in levelList\" :key=\"item.path\">\n <a v-if=\"index === 0\" @click.prevent=\"handleLink(item, index)\">{{\n item.meta.title\n }}</a>\n\n <span\n v-else\n :class=\"{ 'no-redirect': index == levelList.length - 1 }\"\n >{{ item.meta.title }}</span\n >\n </el-breadcrumb-item>\n </transition-group>\n </el-breadcrumb>\n</template>\n\n<script>\nimport pathToRegexp from \"path-to-regexp\";\n\nexport default {\n data() {\n return {\n levelList: null,\n };\n },\n watch: {\n $route() {\n this.getBreadcrumb();\n },\n },\n created() {\n this.getBreadcrumb();\n },\n methods: {\n getBreadcrumb() {\n // only show routes with meta.title\n let matched = this.$route.matched.filter(\n (item) => item.meta && item.meta.title\n );\n const first = matched[0];\n\n if (!this.isDashboard(first)) {\n matched = [{ path: \"/dashboard\", meta: { title: \"首页\" } }].concat(\n matched\n );\n }\n\n this.levelList = matched.filter(\n (item) => item.meta && item.meta.title && item.meta.breadcrumb !== false\n );\n },\n isDashboard(route) {\n const name = route && route.name;\n if (!name) {\n return false;\n }\n return (\n name.trim().toLocaleLowerCase() === \"Dashboard\".toLocaleLowerCase()\n );\n },\n pathCompile(path) {\n const { params } = this.$route;\n var toPath = pathToRegexp.compile(path);\n return toPath(params);\n },\n handleLink(item, index) {\n if (index === 0) {\n const { redirect, path } = item;\n if (redirect) {\n this.$router.push(redirect);\n return;\n }\n this.$router.push(this.pathCompile(path));\n }\n },\n },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.app-breadcrumb.el-breadcrumb {\n display: inline-block;\n width: 100%;\n font-size: 14px;\n line-height: 40px;\n padding-left: 8px;\n background-color: rgb(245, 245, 245);\n\n .no-redirect {\n color: #2766dd;\n cursor: text;\n }\n}\n</style>\n"]}]}