index.vue
1.72 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
<el-container class="main-container">
<el-header height="60px" style="padding: 0;">
<ui-header/>
</el-header>
<el-main>
<el-container>
<transition name="fade">
<router-view></router-view>
</transition>
</el-container>
</el-main>
</el-container>
</template>
<script>
import uiHeader from "./UiHeader.vue";
export default {
name: "index",
components: {
uiHeader
},
}
</script>
<style>
body{
font-family: sans-serif;
}
.main-container {
height: 100%;
display: flex;
flex-direction: column;
}
/* --- 核心修改开始 --- */
.el-header {
background-color: #001529; /* 根据你的导航栏颜色调整 */
color: #333;
line-height: 60px;
padding: 0 !important;
z-index: 1000;
}
.el-main {
background-color: #f0f2f5;
color: #333;
text-align: left; /* 修正对齐 */
padding: 0 !important; /* 【关键】去掉默认内边距,否则播放器无法铺满 */
/* 【关键】使用 Flex 布局让子元素(router-view)撑满 */
display: flex;
flex-direction: column;
flex: 1; /* 占据剩余高度 */
overflow: hidden; /* 防止出现双滚动条 */
height: 100%; /* 确保高度传递 */
}
/*定义标题栏*/
.page-header {
background-color: #FFFFFF;
margin-bottom: 1rem;
padding: 0.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.page-title {
font-weight: bold;
text-align: left;
}
.page-header-btn {
text-align: right;
}
</style>
<style scoped>
.fade-enter {
visibility: hidden;
opacity: 0;
}
.fade-leave-to {
display: none;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity .5s ease;
}
.fade-enter-to,
.fade-leave {
visibility: visible;
opacity: 1;
}
</style>