拖旺项目:聊城公交辅助决策系统
master
2022-04-27 493930a42a2ea3e13905ffd8772cdb945baa7bcf
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<template>
 <div class="c-title">
     <div class="_content">
         {{ content }}
     </div>
     <slot></slot>
     <div class="_page-btn" v-if="pageShow">
        <div @click="handlePage(1)" :class="{'_active-left': page == 1}">{{ pageText ?  pageText[1] : `前${maxNum}`}}</div>
        <div @click="handlePage(2)" :class="{'_active-right': page == 2}">{{ pageText ? pageText[2] : `后${maxNum}`}}</div>
     </div>
     <div v-if="moreShow && link" class="_more" @click="handleClick">
        <span>More</span>
        <img src="../../../assets/newImg/icon_more.png" alt="">
    </div>
 
 </div>
</template>
 
<script>
export default {
 name: 'title',
 props: {
     content: String,
     link: String,
     pageShow: Boolean,
     page: [Number, String],
     maxNum: {
         type: [Number, String],
         default: 10
 
     },
     pageText: {
        type: Object,
        default: () => {}
 
     },
     moreShow: {
        type: Boolean,
        default: true
     }
 },
 data () {
    return {
        msg:'Welcome to your vueName'
    }
 },
 methods: {
     handleClick() {
         this.$router.push(this.link)
     },
     handlePage(page) {
         this.$emit('handlePage', page)
     }
 }
}
</script>
 
<style lang="less" scoped>
.c-title {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    line-height: 24px;
    color: #fff;
    position: relative;
    z-index: 10;
    ._content {
        padding-left: 14px;
        position: relative;
        font-weight: 600;
        height: 26px;
        font-family: 'PingFangSC';
        flex: 1;
        &::before {
            content: '';
            width: 4px;
            height: 16px;
            top: 3px;
            background: #00F4ED;
            display: inline-block;
            position: absolute;
            left: 2px;
        }
    }
    ._page-btn {
        background: #06203F;
        border: 1px solid #1185E2;
        color: #fff;
        border-radius: 4px;
        width: 128px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 10px;
        margin-bottom: 5px;
        &>div {
            flex: 1;
            cursor: pointer;
            text-align: center;
        }
        ._active-left {
            background: #1185E2;
            border-radius:      4px 0px 0px 4px 
        }
        ._active-right {
            background: #1185E2;
            border-radius:      0px 4px 4px 0px 
        }
 
 
    } 
    ._more {
        margin-right: 10px;
        margin-left: 10px;
        cursor: pointer;
        font-size: 12px;
        img {
            width: 12px;
            height: 12px;
        }
    }
}
 
</style>