1 line
4.0 KiB
JSON
1 line
4.0 KiB
JSON
{"remainingRequest":"/Users/kang/Gitea/vue-element-admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/kang/Gitea/vue-element-admin/src/components/Breadcrumb/index.vue?vue&type=style&index=0&id=b50ef614&lang=scss&scoped=true","dependencies":[{"path":"/Users/kang/Gitea/vue-element-admin/src/components/Breadcrumb/index.vue","mtime":1754409279861},{"path":"/Users/kang/Gitea/vue-element-admin/node_modules/css-loader/dist/cjs.js","mtime":1754409278208},{"path":"/Users/kang/Gitea/vue-element-admin/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":1754409279720},{"path":"/Users/kang/Gitea/vue-element-admin/node_modules/postcss-loader/src/index.js","mtime":1754409279211},{"path":"/Users/kang/Gitea/vue-element-admin/node_modules/sass-loader/dist/cjs.js","mtime":1754409279493},{"path":"/Users/kang/Gitea/vue-element-admin/node_modules/cache-loader/dist/cjs.js","mtime":1754409278035},{"path":"/Users/kang/Gitea/vue-element-admin/node_modules/vue-loader/lib/index.js","mtime":1754409279720}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgouYXBwLWJyZWFkY3J1bWIuZWwtYnJlYWRjcnVtYiB7CiAgZGlzcGxheTogaW5saW5lLWJsb2NrOwogIGZvbnQtc2l6ZTogMTRweDsKICBsaW5lLWhlaWdodDogNTBweDsKICBtYXJnaW4tbGVmdDogOHB4OwoKICAubm8tcmVkaXJlY3QgewogICAgY29sb3I6ICM5N2E4YmU7CiAgICBjdXJzb3I6IHRleHQ7CiAgfQp9Cg=="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA;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 <span v-if=\"item.redirect==='noRedirect'||index==levelList.length-1\" class=\"no-redirect\">\n {{ generateTitle(item.meta.title) }}\n </span>\n <a v-else @click.prevent=\"handleLink(item)\">{{ generateTitle(item.meta.title) }}</a>\n </el-breadcrumb-item>\n </transition-group>\n </el-breadcrumb>\n</template>\n\n<script>\nimport { generateTitle } from '@/utils/i18n'\nimport pathToRegexp from 'path-to-regexp'\n\nexport default {\n data() {\n return {\n levelList: null\n }\n },\n watch: {\n $route(route) {\n // if you go to the redirect page, do not update the breadcrumbs\n if (route.path.startsWith('/redirect/')) {\n return\n }\n this.getBreadcrumb()\n }\n },\n created() {\n this.getBreadcrumb()\n },\n methods: {\n generateTitle,\n getBreadcrumb() {\n // only show routes with meta.title\n let matched = this.$route.matched.filter(item => item.meta && item.meta.title)\n const first = matched[0]\n\n if (!this.isDashboard(first)) {\n matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched)\n }\n\n this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)\n },\n isDashboard(route) {\n const name = route && route.name\n if (!name) {\n return false\n }\n return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()\n },\n pathCompile(path) {\n // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561\n const { params } = this.$route\n var toPath = pathToRegexp.compile(path)\n return toPath(params)\n },\n handleLink(item) {\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</script>\n\n<style lang=\"scss\" scoped>\n.app-breadcrumb.el-breadcrumb {\n display: inline-block;\n font-size: 14px;\n line-height: 50px;\n margin-left: 8px;\n\n .no-redirect {\n color: #97a8be;\n cursor: text;\n }\n}\n</style>\n"]}]} |