index.vue
840 Bytes
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
<template>
<div>
<div class="title">
<p>{{text}}</p>
<p class="rightText" v-if="pShow" @click="topClick">{{rightText}}</p>
</div>
</div>
</template>
<script>
export default {
props: ['text', 'pShow', 'rightText'],
data () {
return {}
},
methods: {
topClick () {
this.$emit('topClick')
}
}
}
</script>
<style lang="less" scoped>
.title {
width: 100%;
height: 44px;
background-color: #333;
position: fixed;
top: 0;
left: 0;
color: #fff;
font-size: 16px;
// line-height: 44px;
text-align: center;
z-index: 10;
display: flex;
align-items: center;
&>p:first-child {
line-height: 20px;
flex: 1;
}
.rightText {
position: absolute;
top: 0;
right: 20px;
line-height: 44px;
}
}
</style>