Skip to content

Commit

Permalink
fix: page redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Sep 7, 2019
1 parent fe69816 commit e1fd046
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/MultiTab/MultiTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export default {
this.activeKey = val
}).$on('close', val => {
if (!val) {
this.remove(this.activeKey)
this.closeThat(this.activeKey)
return
}
this.remove(val)
this.closeThat(val)
})
this.pages.push(this.$route)
Expand Down
13 changes: 12 additions & 1 deletion src/mock/services/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ const userNav = (options) => {
'title': '仪表盘',
'show': true
},
'component': 'RouteView'
'component': 'RouteView',
'redirect': '/dashboard/workplace'
},
{
'name': 'analysis',
Expand Down Expand Up @@ -413,6 +414,16 @@ const userNav = (options) => {
},
'component': 'Workplace'
},
{
'name': 'tests',
'parentId': 1,
'id': 8,
'meta': {
'title': '测试功能',
'show': true
},
'component': 'TestWork'
},
{
'name': 'permission',
'parentId': 10,
Expand Down
3 changes: 2 additions & 1 deletion src/router/generator-routers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const constantRouterComponents = {

// 你需要动态引入的页面组件
'Analysis': () => import('@/views/dashboard/Analysis'),
'Workplace': () => import('@/views/dashboard/Workplace')
'Workplace': () => import('@/views/dashboard/Workplace'),
'TestWork': () => import('@/views/dashboard/TestWork')
}

// 前端未找到页面路由(固定不用改)
Expand Down
30 changes: 30 additions & 0 deletions src/views/dashboard/TestWork.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div>
<h2>本页面内容均为测试功能,暂不提供稳定性保证</h2>
<a-divider />
<div class="multi-tab-test">
<h4>多标签组件测试功能</h4>
<a-button @click="handleCloseCurrentTab" style="margin-right: 16px;">关闭当前页</a-button>
<a-button @click="handleOpenTab">打开 任务列表</a-button>
</div>
<a-divider />
</div>
</template>

<script>
export default {
name: 'TestWork',
methods: {
handleCloseCurrentTab () {
this.$multiTab.close()
},
handleOpenTab () {
this.$multiTab.open('/features/task')
}
}
}
</script>

<style scoped>
</style>

0 comments on commit e1fd046

Please sign in to comment.