Commit 224c1481 authored by MyName's avatar MyName
parents 951c16b3 311df8eb
...@@ -52,13 +52,13 @@ export default { ...@@ -52,13 +52,13 @@ export default {
}, },
iconName() { iconName() {
return function(val) { return function(val) {
let svgIcon = val.meta.icon, currentIcon = '' let svgIcon = val.meta && val.meta.icon, currentIcon = ''
let icon = this.isActive(val) ? svgIcon+'Tags' : svgIcon+'Tag' let icon = this.isActive(val) ? svgIcon+'Tags' : svgIcon+'Tag'
if (!svgIcon) { if (!svgIcon) {
const index = val.path.indexOf('/', val.path.indexOf('/') + 1) const index = val.path.indexOf('/', val.path.indexOf('/') + 1)
const parentPath = val.path.slice(0, index) const parentPath = val.path.slice(0, index)
const currentRoute = this.$router.options.routes.find(item => item.path === parentPath) const currentRoute = this.$router.options.routes.find(item => item.path === parentPath)
currentIcon = currentRoute.meta.icon currentIcon = currentRoute.meta && currentRoute.meta.icon
icon = this.isActive(val) ? currentIcon+'Tags' : currentIcon+'Tag' icon = this.isActive(val) ? currentIcon+'Tags' : currentIcon+'Tag'
} }
icon = (svgIcon && svgIcon != '#') || (currentIcon && svgIcon != '#') ? icon : this.isActive(val) ? 'defaultTags' : 'defaultTag' icon = (svgIcon && svgIcon != '#') || (currentIcon && svgIcon != '#') ? icon : this.isActive(val) ? 'defaultTags' : 'defaultTag'
......
...@@ -98,13 +98,13 @@ export const constantRoutes = [ ...@@ -98,13 +98,13 @@ export const constantRoutes = [
path: 'party-a', path: 'party-a',
component: () => import('@/views/detail/party-a/index'), component: () => import('@/views/detail/party-a/index'),
name: 'PartyA', name: 'PartyA',
meta: { title: '甲方详情', icon: 'custom' } meta: { title: '甲方详情' }
}, },
{ {
path: 'party-b', path: 'party-b',
component: () => import('@/views/detail/party-b/index'), component: () => import('@/views/detail/party-b/index'),
name: 'PartyB', name: 'PartyB',
meta: { title: '已方详情', icon: 'user' } meta: { title: '已方详情' }
} }
] ]
}, },
......
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