Unverified Commit 6a553ec3 by Sendya

fix: menu render target path

parent fec00eb1
...@@ -101,16 +101,15 @@ export default { ...@@ -101,16 +101,15 @@ export default {
}, },
renderMenuItem (menu) { renderMenuItem (menu) {
const target = menu.meta.target || null const target = menu.meta.target || null
const props = { const tag = target && 'a' || 'router-link'
to: { name: menu.name }, const props = { to: { name: menu.name } }
target: target const attrs = { href: menu.path, target: menu.meta.target }
}
return ( return (
<Item {...{ key: menu.path }}> <Item {...{ key: menu.path }}>
<router-link {...{ props }}> <tag {...{ props, attrs }}>
{this.renderIcon(menu.meta.icon)} {this.renderIcon(menu.meta.icon)}
<span>{menu.meta.title}</span> <span>{menu.meta.title}</span>
</router-link> </tag>
</Item> </Item>
) )
}, },
......
...@@ -25,12 +25,11 @@ export const asyncRouterMap = [ ...@@ -25,12 +25,11 @@ export const asyncRouterMap = [
component: () => import('@/views/dashboard/Analysis'), component: () => import('@/views/dashboard/Analysis'),
meta: { title: '分析页', keepAlive: false, permission: [ 'dashboard' ] } meta: { title: '分析页', keepAlive: false, permission: [ 'dashboard' ] }
}, },
// 外部链接
{ {
path: '/dashboard/monitor', path: 'https://www.baidu.com/',
name: 'Monitor', name: 'Monitor',
hidden: true, meta: { title: '监控页', target: '_blank' }
component: () => import('@/views/dashboard/Monitor'),
meta: { title: '监控页', keepAlive: true, permission: [ 'dashboard' ] }
}, },
{ {
path: '/dashboard/workplace', path: '/dashboard/workplace',
......
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