zhangxiaoxu123456
2021-12-20 301289e539c417995f95f5cb91fd1f6043bb7cfd
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
<template>
    <view class="u-demo">
        <view class="u-demo-wrap">
            <view class="u-demo-title">演示效果</view>
            <view class="u-demo-area">
                <u-steps :direction="direction" :current="current" :list="steps" :mode="mode" :icon="icon"></u-steps>
            </view>
        </view>
        <view class="u-config-wrap">
            <view class="u-config-title u-border-bottom">
                参数配置
            </view>
            <view class="u-config-item">
                <view class="u-item-title">模式</view>
                <u-subsection :list="['number', 'dot']" @change="modeChange"></u-subsection>
            </view>
            <view class="u-config-item">
                <view class="u-item-title">方向</view>
                <u-subsection :list="['横向', '竖向']" @change="directionChange"></u-subsection>
            </view>
            <view class="u-config-item">
                <view class="u-item-title">自定义图标</view>
                <u-subsection :list="['否', '是']" @change="iconChange"></u-subsection>
            </view>
            <view class="u-config-item">
                <view class="u-item-title">当前步值</view>
                <u-subsection :list="['1', '2', '3', '4']" @change="stepChange"></u-subsection>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                steps: [{
                    name: '下单'
                }, {
                    name: '出库'
                }, {
                    name: '运输'
                }, {
                    name: '签收'
                }, ],
                current: 0,
                icon: 'checkmark',
                mode: 'number',
                direction: 'row'
            }
        },
        methods: {
            modeChange(index) {
                this.mode = index == 0 ? 'number' : 'dot';
            },
            stepChange(index) {
                this.current = [0, 1, 2, 3][index];
            },
            iconChange(index) {
                this.icon = index == 0 ? 'checkmark' : 'map-fill';
            },
            directionChange(index) {
                this.direction = index == 0 ? 'row' : 'column';
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .wrap {
        padding: 24rpx;
    }
    
    .box {
        margin: 50rpx 0;
    }
</style>