|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
- <div class="main-container">
|
|
|
- <div class="menu-container">
|
|
|
- <div class="tab-container-large">
|
|
|
+ <div class="user-home-layout">
|
|
|
+ <div class="main-container">
|
|
|
+ <div class="menu-container-large">
|
|
|
<template v-for="tab of tabs">
|
|
|
<tab-icon-button
|
|
|
:active="currentRouteName.match(tab.name)"
|
|
|
@@ -13,17 +13,12 @@
|
|
|
</tab-icon-button>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <div class="view-container">
|
|
|
- <transition name="fade" mode="out-in">
|
|
|
- <router-view/>
|
|
|
- </transition>
|
|
|
+ <div class="tab-container">
|
|
|
+ <router-view/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="preview-container">
|
|
|
- <slot name="preview"></slot>
|
|
|
- </div>
|
|
|
|
|
|
- <div class="tab-container-small">
|
|
|
+ <div class="menu-container-small">
|
|
|
<template v-for="tab of tabs">
|
|
|
<tab-icon-button
|
|
|
:active="currentRouteName.match(tab.name)"
|
|
|
@@ -42,20 +37,35 @@ import TabIconButton from '@/components/TabIconButton'
|
|
|
|
|
|
export default {
|
|
|
components: { TabIconButton },
|
|
|
- props: ['tabs'],
|
|
|
+ props: ['tabs', 'role'],
|
|
|
data () {
|
|
|
return {
|
|
|
currentRouteName: this.$route.name
|
|
|
}
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ this.resizeHandler()
|
|
|
+ window.addEventListener('resize', this.resizeHandler)
|
|
|
+ },
|
|
|
+ destroyed () {
|
|
|
+ window.removeEventListener('resize', this.resizeHandler)
|
|
|
+ },
|
|
|
watch: {
|
|
|
$route () {
|
|
|
- this.currentRouteName = this.$route.name
|
|
|
+ console.log(this.$route)
|
|
|
+ this.currentRouteName = this.$route.path
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ resizeHandler () {
|
|
|
+ if (window.innerWidth < 900) {
|
|
|
+ this.componentType = 'full-screen-component'
|
|
|
+ } else {
|
|
|
+ this.componentType = 'tab-side-component'
|
|
|
+ }
|
|
|
+ },
|
|
|
handleIconButtonClick (name) {
|
|
|
- this.$router.push(name)
|
|
|
+ this.$router.push(`/${this.role}/${name}`)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -64,7 +74,7 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
@import '~@/style/theme.scss';
|
|
|
|
|
|
-.main-container {
|
|
|
+.user-home-layout {
|
|
|
height: 100vh;
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
@@ -72,7 +82,7 @@ export default {
|
|
|
justify-content: center;
|
|
|
}
|
|
|
|
|
|
-.menu-container {
|
|
|
+.main-container {
|
|
|
display: flex;
|
|
|
width: 100%;
|
|
|
margin: 0 auto;
|
|
|
@@ -81,7 +91,7 @@ export default {
|
|
|
|
|
|
// 大屏幕情况
|
|
|
@media (min-width: 600px) {
|
|
|
- .tab-container-large {
|
|
|
+ .menu-container-large {
|
|
|
padding: 24px 18px;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
@@ -93,32 +103,25 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .view-container {
|
|
|
+ .tab-container {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
padding: 24px 18px;
|
|
|
- max-width: 460px;
|
|
|
+ max-width: 800px;
|
|
|
}
|
|
|
|
|
|
- .tab-container-small {
|
|
|
+ .menu-container-small {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.tab {
|
|
|
- min-height: 350px;
|
|
|
- padding: 40px;
|
|
|
- width: 320px;
|
|
|
- flex: 1;
|
|
|
-}
|
|
|
-
|
|
|
// 小屏幕情况
|
|
|
@media (max-width: 599px) {
|
|
|
- .tab-container-large {
|
|
|
+ .menu-container-large {
|
|
|
display: none;
|
|
|
}
|
|
|
|
|
|
- .view-container {
|
|
|
+ .tab-container {
|
|
|
box-sizing: border-box;
|
|
|
height: calc(100vh - 54px);
|
|
|
padding: 48px 24px;
|
|
|
@@ -127,12 +130,12 @@ export default {
|
|
|
max-width: 460px;
|
|
|
}
|
|
|
|
|
|
- .main-container {
|
|
|
+ .user-home-layout {
|
|
|
justify-content: unset;
|
|
|
min-height: calc(100vh - 54px);
|
|
|
}
|
|
|
|
|
|
- .tab-container-small {
|
|
|
+ .menu-container-small {
|
|
|
z-index: 2;
|
|
|
backdrop-filter: saturate(180%) blur(20px);
|
|
|
background: rgba(255, 255, 255, 0.8);
|
|
|
@@ -147,9 +150,8 @@ export default {
|
|
|
justify-content: space-around;
|
|
|
}
|
|
|
.tab {
|
|
|
- width: unset;
|
|
|
+ min-width: unset;
|
|
|
padding: unset;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</style>
|