schangxiang@126.com
2025-09-04 7cf848238dc91916ebcd1b1de69b373bbf2357a3
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
<template>
    <view class="page-header-compontent">
        <view class="left-action" v-if="hasLeft" @tap="onAsideClick('left')"><slot name="left"></slot></view>
        <view class="title"><slot></slot></view>
        <view class="right-action" v-if="hasRight" @tap="onAsideClick('right')"><slot name="right"></slot></view>
    </view>
</template>
 
<script>
export default {
    name:'pageheadercompontent',
    props:{
        hasLeft:{
            type:Boolean,
            default:false
        },
        hasRight:{
            type:Boolean,
            default:false
        }
    },
    methods:{
        onAsideClick(type){
            this.$emit('tclick',type)
        }
    }
}
</script>
 
<style scoped lang="scss">
.page-header-compontent{
    width: 100%;
    height: 120rpx;
    position: relative;
    color: #FFFFFF;
    background: linear-gradient(to right, #0067ff , #00b5ff);
    .title{
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.2em;
    }
    >.left-action,>.right-action{
        position: absolute;
        top:0;
        height: 100%;
        z-index: 5;
        display: flex;
        align-items: center;
    }
    >.left-action{
        left: 0rpx;
        padding-left: 8px;
    }
    >.right-action{
        right: 0rpx;
        padding-right: 8px;
    }
}
</style>