-
zhangwei
2025-03-06 02ad32582e3a3b0e6f4b2d1b50593eff1d0558e3
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
<template>
    <!--本文件由FirstUI授权予四川政采招投标咨询有限公司(会员ID:1  63,营业执照号:9 1510  1    3133  2 00 61     9 3K)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
    <view class="fui-timeaxis__wrap"
        :style="{paddingTop:padding[0] || 0,paddingRight:padding[1]||0,paddingBottom:padding[2] || padding[0]||0,paddingLeft:padding[3] || padding[1]||0,background:background}">
        <slot></slot>
    </view>
</template>
 
<script>
    export default {
        name: "fui-timeaxis",
        props: {
            padding: {
                type: Array,
                default () {
                    return []
                }
            },
            background: {
                type: String,
                default: 'transparent'
            },
            leftWidth: {
                type: [Number, String],
                default: 0
            },
            width: {
                type: [Number, String],
                default: 48
            },
            // #ifdef APP-NVUE
            lineWidth: {
                type: [Number, String],
                default: 0.5
            },
            // #endif
            // #ifndef APP-NVUE
            lineWidth: {
                type: [Number, String],
                default: 1
            }
            // #endif
 
        },
        provide() {
            return {
                timeaxis: this
            }
        },
        created() {
            this.children = []
        },
        watch: {
            width(val) {
                this.children.forEach(item => {
                    item.width = val
                })
            },
            lineWidth(val) {
                this.children.forEach(item => {
                    item.lineWidth = val
                })
            },
            leftWidth(val) {
                this.children.forEach(item => {
                    item.leftWidth = val
                })
            }
        }
    }
</script>
 
<style scoped>
    .fui-timeaxis__wrap {
        /* #ifndef APP-NVUE */
        width: 100%;
        box-sizing: border-box;
        /* #endif */
    }
</style>