Commit f69a7c3c by kokoroli

fix: router redirect

parent ddd32afc
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
<div class="page-header-index-wide"> <div class="page-header-index-wide">
<a-breadcrumb class="breadcrumb"> <a-breadcrumb class="breadcrumb">
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index"> <a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
<router-link v-if="item.name != name" :to="{ path: item.path }"> <router-link
{{ item.meta.title }} v-if="item.name != name && index != 1"
</router-link> :to="{ path: item.path === '' ? '/' : item.path }"
>{{ item.meta.title }}</router-link>
<span v-else>{{ item.meta.title }}</span> <span v-else>{{ item.meta.title }}</span>
</a-breadcrumb-item> </a-breadcrumb-item>
</a-breadcrumb> </a-breadcrumb>
...@@ -34,7 +35,6 @@ ...@@ -34,7 +35,6 @@
<slot name="pageMenu"></slot> <slot name="pageMenu"></slot>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
this.getBreadcrumb() this.getBreadcrumb()
}, },
methods: { methods: {
getBreadcrumb () { getBreadcrumb () {
this.breadList = [] this.breadList = []
// this.breadList.push({name: 'index', path: '/dashboard/', meta: {title: '首页'}}) // this.breadList.push({name: 'index', path: '/dashboard/', meta: {title: '首页'}})
...@@ -101,137 +101,136 @@ export default { ...@@ -101,137 +101,136 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.page-header { .page-header {
background: #fff; background: #fff;
padding: 16px 32px 0; padding: 16px 32px 0;
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
.breadcrumb { .breadcrumb {
margin-bottom: 16px; margin-bottom: 16px;
} }
.detail { .detail {
display: flex; display: flex;
/*margin-bottom: 16px;*/ /*margin-bottom: 16px;*/
.avatar { .avatar {
flex: 0 1 72px; flex: 0 1 72px;
margin: 0 24px 8px 0; margin: 0 24px 8px 0;
& > span { & > span {
border-radius: 72px; border-radius: 72px;
display: block; display: block;
width: 72px; width: 72px;
height: 72px; height: 72px;
}
} }
}
.main { .main {
width: 100%; width: 100%;
flex: 0 1 auto; flex: 0 1 auto;
.row { .row {
display: flex; display: flex;
width: 100%; width: 100%;
.avatar { .avatar {
margin-bottom: 16px; margin-bottom: 16px;
}
} }
}
.title { .title {
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 28px;
font-weight: 500; font-weight: 500;
color: rgba(0,0,0,.85); color: rgba(0,0,0,.85);
margin-bottom: 16px; margin-bottom: 16px;
flex: auto; flex: auto;
} }
.logo { .logo {
width: 28px; width: 28px;
height: 28px; height: 28px;
border-radius: 4px; border-radius: 4px;
margin-right: 16px; margin-right: 16px;
} }
.content, .headerContent { .content, .headerContent {
flex: auto; flex: auto;
color: rgba(0,0,0,.45); color: rgba(0,0,0,.45);
line-height: 22px; line-height: 22px;
.link { .link {
margin-top: 16px; margin-top: 16px;
line-height: 24px; line-height: 24px;
a { a {
font-size: 14px; font-size: 14px;
margin-right: 32px; margin-right: 32px;
}
} }
} }
.extra { }
flex: 0 1 auto; .extra {
margin-left: 88px; flex: 0 1 auto;
min-width: 242px; margin-left: 88px;
text-align: right; min-width: 242px;
} text-align: right;
.action { }
margin-left: 56px; .action {
min-width: 266px; margin-left: 56px;
flex: 0 1 auto; min-width: 266px;
text-align: right; flex: 0 1 auto;
&:empty { text-align: right;
display: none; &:empty {
} display: none;
} }
} }
} }
} }
}
.mobile .page-header { .mobile .page-header {
.main { .main {
.row { .row {
flex-wrap: wrap; flex-wrap: wrap;
.avatar { .avatar {
flex: 0 1 25%; flex: 0 1 25%;
margin: 0 2% 8px 0; margin: 0 2% 8px 0;
} }
.content, .headerContent { .content, .headerContent {
flex: 0 1 70%; flex: 0 1 70%;
.link { .link {
margin-top: 16px; margin-top: 16px;
line-height: 24px; line-height: 24px;
a { a {
font-size: 14px; font-size: 14px;
margin-right: 10px; margin-right: 10px;
}
} }
} }
.extra { }
flex: 1 1 auto; .extra {
margin-left: 0; flex: 1 1 auto;
min-width: 0; margin-left: 0;
text-align: right; min-width: 0;
} text-align: right;
.action { }
margin-left: unset; .action {
min-width: 266px; margin-left: unset;
flex: 0 1 auto; min-width: 266px;
text-align: left; flex: 0 1 auto;
margin-bottom: 12px; text-align: left;
&:empty { margin-bottom: 12px;
display: none; &:empty {
} display: none;
} }
} }
} }
} }
</style> </style>
...@@ -43,7 +43,7 @@ export const asyncRouterMap = [ ...@@ -43,7 +43,7 @@ export const asyncRouterMap = [
// forms // forms
{ {
path: '/form', path: '/form',
redirect: '/form/basic-form', redirect: '/form/base-form',
component: PageView, component: PageView,
meta: { title: '表单页', icon: 'form', permission: [ 'form' ] }, meta: { title: '表单页', icon: 'form', permission: [ 'form' ] },
children: [ children: [
...@@ -258,6 +258,7 @@ export const asyncRouterMap = [ ...@@ -258,6 +258,7 @@ export const asyncRouterMap = [
{ {
path: '/account', path: '/account',
component: RouteView, component: RouteView,
redirect: '/account/center',
name: 'account', name: 'account',
meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] }, meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },
children: [ children: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment