Skip to content

Commit

Permalink
fix(components): fix:router-tab-hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekQiaQia committed Jun 16, 2021
1 parent dda61fe commit c6475ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/layout/components/AppMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ export default defineComponent({
const route = useRoute()
// 监听当前路由,判断是否入栈
watchEffect(() => {
console.log(route)
// 判断当前路由中是否已经入栈 route
const flag = tabsOption.value.findIndex((tab: { route: string }) => tab.route === route.fullPath) > -1
console.log('watchEffect route,', route, route.fullPath, flag)
if (!flag) {
if (!flag && !route.meta.hidden) {
store.commit('tabModule/ADD_TAB', { route: route.fullPath, title: route.meta.title, name: route.name })
}
store.commit('tabModule/SET_TAB', route.fullPath)
Expand Down
2 changes: 1 addition & 1 deletion src/views/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default defineComponent({
.container{
position: relative;
background-image:linear-gradient(90deg, #ebebeb, #e6efe8);
background-image:linear-gradient(90deg, #ebebeb, #f5f7f6);
height: 100vh;
display: flex;
justify-content: center;
Expand Down

0 comments on commit c6475ca

Please sign in to comment.