header.vue
1.46 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
<template>
<div class="header">
<div class="header-left">
<slot name="left">
<i class="icon icon-left" @click="goBack"></i>
</slot>
</div>
<div class="header-right">
<slot name="right"></slot>
</div>
<div class="header-main">
<span class="header-title">{{title}}</span>
</div>
</div>
<div class="header-gap"></div>
</template>
<script>
const yoho = require('yoho');
const $ = require('yoho-jquery');
const tip = require('common/tip');
module.exports = {
props: ['title'],
methods: {
goBack() {
yoho.goBack({}, function() {}, function() {});
}
}
}
</script>
<style>
.header {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 210;
padding-left: 30px;
padding-right: 30px;
width: 100%;
height: 60px;
line-height: 60px;
font-size: 48px;
background-color: #fff;
.icon, .header-title {
vertical-align: middle;
}
}
.header-main {
display: block;
text-align: center;
margin-left: auto;
margin-right: auto;
}
.header-left {
float: left;
}
.header-right {
float: right;
.icon {
margin-left: 30px;
}
}
.header-gap {
height: 60px;
}
</style>