Unverified Commit 6a553ec3 by Sendya

fix: menu render target path

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