index.vue
2.22 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
97
98
99
100
101
102
103
104
<template>
<div class="app-headBox">
<span class="head-inner">
<div class="head-name"> <span>{{headTitle}}</span><div class="head-name-bg"></div></div>
<div class="head-time">{{ headTime }}</div>
</span>
</div>
</template>
<script>
import common from '../../api/common';
export default {
name: "appHeader",
data() {
return {
headTitle:"",//城市智慧停车大数据中心
headTime:''//当前时间
}
},
mounted() {
this.headTitle=appConfig.appTitle;
this.getCurTime()
},
methods: {
getCurTime(){
let _self=this;
_self.headTime=common.getNowFormatDate();
setInterval(function(){
_self.headTime=common.getNowFormatDate();
},1000);//1分钟更新一次
},
}
}
</script>
<style lang="scss" scoped>
.app-headBox {
/*display: flex;*/
/*justify-content: center;*/
/*align-items: center;*/
display: table;
border: 0px solid red;
font-size:18px;
position:relative;
.head-inner{
display: table-cell; /* 让子元素以表格的单元格形式渲染 */
text-align: center;
vertical-align: middle;
}
.head-name >span:first-child{
position: relative;
z-index: 666;
}
.head-name,.head-time{
display: inline-block;
}
.head-name{
font-size:23px;
/*font-weight:bold;*/
width: 884px;
height: 60px;
line-height: 60px;
background: url(../../images/head/bg.svg) no-repeat;
background-size: 100% 100%;
position:relative;
}
.head-name-bg{
background: url(../../images/head/headNameBg.png) no-repeat;
background-size: 100% 100%;
height: 60px;
width:320px;
position: absolute;
top:-4px;
left:280px;
z-index: 10;
}
.head-time{
font-size:14px;
color:#b2c2cf;
width: 101px;
float:right;;
right: 0px;
top:0;
bottom:0;
text-align: left;
position:absolute;
display: flex;
justify-content: center;
align-items: center;
}
.head-time::before{
content: " ";width: 35px; height: 35px;
background: url("../../images/head/time.png") no-repeat center; background-size: 100%;
position: absolute;
left:0;
margin-left:-45px;
}
}
</style>