progress.uvue 1.6 KB
Newer Older
Y
init  
yurj26 已提交
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
<template>
    <view>
        <page-head :title="title"></page-head>
        <view class="uni-padding-wrap uni-common-mt">
            <view class="progress-box">
                <progress :percent="pgList[0]" :show-info="true" :stroke-width="3" />
            </view>
            <view class="progress-box">
                <progress :percent="pgList[1]" :stroke-width="3" />
            </view>
            <view class="progress-box">
                <progress :percent="pgList[2]" :stroke-width="3" />
            </view>
            <view class="progress-box">
                <progress :percent="pgList[3]" activeColor="#10AEFF" :stroke-width="3" />
            </view>
            <view class="progress-control">
                <button type="primary" @click="setProgress" class="button">设置进度</button>
                <button type="warn" @click="clearProgress" class="button">清除进度</button>
            </view>
        </view>
    </view>
</template>
<script lang="ts">
    export default {
        data() {
            return {
                title: 'progress',
                pgList: [0, 0, 0, 0] as number[]
            }
        },
        methods: {
            setProgress() {
                this.pgList = [20, 40, 60, 80] as number[]
            },
            clearProgress() {
                this.pgList = [0, 0, 0, 0] as number[]
            }
        }
    }
</script>

<style>
    .progress-box {
        height: 50rpx;
        margin-bottom: 60rpx;
    }

    .progress-cancel {
        margin-left: 40rpx;
    }

    .button {
        margin-top: 20rpx;
    }
</style>