-
zhangwei
2024-09-30 2e61c194b816364fe4fbab967fee13dbefe86216
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
<template>
    <!--本文件由FirstUI授权予四川政采招投标咨询有限公司(会员ID: 1 63,营业执照号:9   1 5 10 13 1   3 3   2 0 0619 3K)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
    <view class="fui-divider__wrap" :style="{ height: height + 'rpx' }">
        <view class="fui-divider__wrap" :style="{width:width, height: height + 'rpx' }">
            <view class="fui-divider__line" :style="{ background: dividerColor}">
            </view>
            <view class="fui-divider__text-box">
                <slot></slot>
                <text class="fui-divider__text"
                    :style="{fontWeight: fontWeight,color: color, fontSize: size + 'rpx',lineHeight: size + 'rpx'}"
                    v-if="text">{{text}}</text>
            </view>
            <view class="fui-divider__line" :style="{ background: dividerColor}">
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        name: 'fui-divider',
        props: {
            text: {
                type: String,
                default: ''
            },
            //divider占据高度,单位rpx
            height: {
                type: [Number, String],
                default: 100
            },
            //divider宽度
            width: {
                type: String,
                default: '400rpx'
            },
            //divider颜色
            dividerColor: {
                type: String,
                default: '#CCCCCC'
            },
            //文字颜色
            color: {
                type: String,
                default: '#B2B2B2'
            },
            //文字大小 rpx
            size: {
                type: [Number, String],
                default: 24
            },
            fontWeight: {
                type: [Number, String],
                default: 400
            }
        }
    };
</script>
 
<style scoped>
    .fui-divider__wrap {
        /* #ifndef APP-NVUE */
        width: 100%;
        display: flex;
        box-sizing: border-box;
        /* #endif */
        text-align: center;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
 
    .fui-divider__line {
        /* #ifdef APP-NVUE */
        height: 0.5px;
        /* #endif */
 
        /* #ifndef APP-NVUE */
        height: 1px;
        -webkit-transform: scaleY(0.5) translateZ(0);
        transform: scaleY(0.5) translateZ(0);
        /* #endif */
        flex: 1;
    }
 
    .fui-divider__text-box {
        position: relative;
        text-align: center;
        padding: 0 8rpx;
        z-index: 1;
        /* #ifndef APP-NVUE */
        display: flex;
        flex-shrink: 0;
        /* #endif */
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
 
    .fui-divider__text {
        padding: 0 10rpx;
    }
</style>