perf[Breadcrumb]: set noredirect => noRedirect

This commit is contained in:
Pan 2019-04-16 13:51:14 +08:00
parent 067a2910d4
commit 4ee334ad83
6 changed files with 13 additions and 15 deletions

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',

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]

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)

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',

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',

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',