litian
2024-06-14 752ed00ca8085cd8bb7e602d55fde39d45f487be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<template>
  <div class="contentPage">
    <div class="headerBox">数字教材平台</div>
    <div class="contentBox">
      <div class="leftBox">
        <menuView />
      </div>
      <div class="rightBox">
          <router-view />
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { useRouter, onBeforeRouteUpdate } from 'vue-router'
import { ref, onMounted } from 'vue'
import menuView from '@/views/components/menuView.vue'
const router = useRouter()
const routerVal = router.currentRoute.value
const path = ref(routerVal.path)
onBeforeRouteUpdate(async (to, from) => {
  path.value = to.fullPath
})
onMounted(() => {})
 
const goRouter = (item) => {
  if (!localStorage.getItem('token')) {
    return router.push({
      path: '/home',
      query: {
        showLogin: '1'
      }
    })
  }
  router.push({ path: item.path })
}
</script>
 
<style lang="less">
.contentPage {
  height: 100%;
  width: 100%;
  font-size:14px;
}
.headerBox {
  height: 48px;
  width: 100%;
  background: #fff;
  box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.07);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  
  font-size: 24px;
  padding:0 20px;
  line-height:48px;
  color: #87CCFF;
  font-family: Alibaba;
}
.contentBox {
  height:100%;
  display: flex;
  background: #f1f1f1;
  padding-top: 48px;
  .leftBox {
    background: #fff;
    width:80px;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  .rightBox{
    width:100%;
    height:100%;
    flex:1;
  }
}
</style>