1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template>
- <div class="app-container">
- <Header :user-type="userType" />
- <section class="app-main">
- <transition name="fade-transfrom" mode="out-in">
- <router-view :key="key"></router-view>
- </transition>
- </section>
- </div>
- </template>
- <script>
- import Header from './components/Header';
- export default {
- name: 'Layout',
- components: {
- Header
- },
- computed: {
- key() {
- return this.$route.path;
- },
- userType() {
- return this.$store.state.user.user_type === 'teacher' ? '教师' : '学员';
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .app-container {
- height: 100%;
- padding-top: $header-h;
- .app-main {
- height: 100%;
- min-height: calc(100vh - #{$header-h});
- width: 100%;
- position: relative;
- }
- }
- </style>
|