THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

perf[Breadcrumb]: set noredirect => noRedirect

tags/4.1.0
Pan 11 months ago
parent
commit
4ee334ad83
6 changed files with 13 additions and 15 deletions
  1. +6
    -6
      mock/role/routes.js
  2. +2
    -1
      src/components/Breadcrumb/index.vue
  3. +1
    -1
      src/components/HeaderSearch/index.vue
  4. +2
    -5
      src/router/index.js
  5. +1
    -1
      src/router/modules/charts.js
  6. +1
    -1
      src/router/modules/components.js

+ 6
- 6
mock/role/routes.js View File

@@ -129,7 +129,7 @@ export const asyncRoutes = [
{
path: '/components',
component: 'layout/Layout',
redirect: 'noredirect',
redirect: 'noRedirect',
name: 'ComponentDemo',
meta: {
title: 'components',
@@ -225,7 +225,7 @@ export const asyncRoutes = [
{
path: '/charts',
component: 'layout/Layout',
redirect: 'noredirect',
redirect: 'noRedirect',
name: 'Charts',
meta: {
title: 'charts',
@@ -361,7 +361,7 @@ export const asyncRoutes = [
{
path: '/error',
component: 'layout/Layout',
redirect: 'noredirect',
redirect: 'noRedirect',
name: 'ErrorPages',
meta: {
title: 'errorPages',
@@ -386,7 +386,7 @@ export const asyncRoutes = [
{
path: '/error-log',
component: 'layout/Layout',
redirect: 'noredirect',
redirect: 'noRedirect',
children: [
{
path: 'log',
@@ -472,7 +472,7 @@ export const asyncRoutes = [
{
path: '/theme',
component: 'layout/Layout',
redirect: 'noredirect',
redirect: 'noRedirect',
children: [
{
path: 'index',
@@ -486,7 +486,7 @@ export const asyncRoutes = [
{
path: '/clipboard',
component: 'layout/Layout',
redirect: 'noredirect',
redirect: 'noRedirect',
children: [
{
path: 'index',


+ 2
- 1
src/components/Breadcrumb/index.vue View File

@@ -2,7 +2,7 @@
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{
generateTitle(item.meta.title) }}</span>
<a v-else @click.prevent="handleLink(item)">{{ generateTitle(item.meta.title) }}</a>
</el-breadcrumb-item>
@@ -31,6 +31,7 @@ export default {
methods: {
generateTitle,
getBreadcrumb() {
// only show routes with name
let matched = this.$route.matched.filter(item => item.name)

const first = matched[0]


+ 1
- 1
src/components/HeaderSearch/index.vue View File

@@ -121,7 +121,7 @@ export default {

data.title = [...data.title, i18ntitle]

if (router.redirect !== 'noredirect') {
if (router.redirect !== 'noRedirect') {
// only push the routes with title
// special case: need to exclude parent router without redirect
res.push(data)


+ 2
- 5
src/router/index.js View File

@@ -20,7 +20,7 @@ import nestedRouter from './modules/nested'
* alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
@@ -224,7 +224,7 @@ export const asyncRoutes = [
{
path: '/error',
component: Layout,
redirect: 'noredirect',
redirect: 'noRedirect',
name: 'ErrorPages',
meta: {
title: 'errorPages',
@@ -249,7 +249,6 @@ export const asyncRoutes = [
{
path: '/error-log',
component: Layout,
redirect: 'noredirect',
children: [
{
path: 'log',
@@ -336,7 +335,6 @@ export const asyncRoutes = [
{
path: '/theme',
component: Layout,
redirect: 'noredirect',
children: [
{
path: 'index',
@@ -350,7 +348,6 @@ export const asyncRoutes = [
{
path: '/clipboard',
component: Layout,
redirect: 'noredirect',
children: [
{
path: 'index',


+ 1
- 1
src/router/modules/charts.js View File

@@ -5,7 +5,7 @@ import Layout from '@/layout'
const chartsRouter = {
path: '/charts',
component: Layout,
redirect: 'noredirect',
redirect: 'noRedirect',
name: 'Charts',
meta: {
title: 'charts',


+ 1
- 1
src/router/modules/components.js View File

@@ -5,7 +5,7 @@ import Layout from '@/layout'
const componentsRouter = {
path: '/components',
component: Layout,
redirect: 'noredirect',
redirect: 'noRedirect',
name: 'ComponentDemo',
meta: {
title: 'components',


Loading…
Cancel
Save