拖旺项目:聊城公交辅助决策系统
zhaoxing
2022-05-08 d5859b70023f40c195c58f81d3abcd14980cb722
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
<template>
    <div 
        class="c-border-decorate"
        :style="{
            borderTop: topShow ? `1px solid rgba(255,255,255,0.2)` : '',
            borderBottom: bottomShow ? `1px solid rgba(255,255,255,0.2)` : '',
            padding: paddingstyle
        }"
    >
        <div  v-if="topShow" class="_border-top"></div>
        <div v-if="topShow" class="_triangle-1"></div>
        <slot></slot>
        <div  v-if="bottomShow" class="_triangle-2"></div>
        <div v-if="bottomShow" class="_border-bottom"></div>
    </div>
</template>
 
<script>
export default {
 name: 'border-decorate',
 props: {
     topShow: {
         type: Boolean,
         default: true
     },
      bottomShow: {
         type: Boolean,
         default: true
     }
 },
 data () {
    return {
        msg:'Welcome to your vueName'
    }
 },
 computed: {
     paddingstyle() {
         if(this.topShow && this.bottomShow) {
             return '15px 15px'
         } else if(!this.topShow && this.bottomShow) {
             return '0px 15px 15px'
         } else if(this.topShow && !this.bottomShow) {
             return '15px 15px 0px'
         } else {
             return '0px 15px'
         }
     }
 }
}
</script>
 
<style lang="less">
.c-border-decorate {
    position: relative;
    min-height: 40px;
    ._border-top::before, ._border-top::after, ._border-bottom::before, ._border-bottom::after {
        content: '';
        display: inline-block;
        position: absolute;
        width: 15px;
        height: 15px;
    }
    ._border-top::before, ._border-top::after {
        top: -1px;
        border-top: 1px solid #389BC7;
    }
    ._border-bottom::before, ._border-bottom::after {
        bottom: -1px;
        border-bottom: 1px solid #389BC7;
    }
    ._border-top::before, ._border-bottom::before {
        
        border-left: 1px solid #389BC7;
        left: 0;
    }
    ._border-top::after, ._border-bottom::after  {
        border-right: 1px solid #389BC7;
        right: 0;
    }
    ._triangle-1, ._triangle-2 {
        position: absolute;
        left: 50%;
        transform: translate(-50%, 0);
        width: 0px;
        height: 0px;
        background: linear-gradient(180deg,#ffe3c4, #fdc392);
        border-radius: 3px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        filter: drop-shadow(0px 0px 8px rgba(251,207,163,0.60));
    }
    ._triangle-1 {
        top: 5px;
        border-top: 10px solid #fdc392;
    }
    ._triangle-2 {
        bottom: 5px;
        border-bottom: 10px solid #fdc392;
 
    }
}
 
</style>