Progress 进度条

 vue dom结构如下:

<div class="content">
	<div class="content_" v-for="(item, i) in dataList" :key="i">
		<el-progress stroke-linecap="square" :show-text="false"
					 :style="{left: 'calc(50% - '+ (item.width/2 + 30)             +'px)',top:'calc(50% - '+ (item.width/2) +'px)'}"
					 :stroke-width="12" :color="item.color" :width="item.width" type="dashboard"
					 :percentage="item.rate" define-back-color="#2B364F"></el-progress>
		<div class="progress-info" :class="'progress-info_' + i">
			<div class="progress-info-line"></div>
			<div class="progress-info-round" :style="{background: item.color}"></div>
			<div class="progress-info-label">{{ item.name }}:</div>
			<div class="progress-info-value">{{ item.count }}</div>
		</div>
	</div>
	<p>{{workCount}}</p>
</div>
dataList = [
	{
		width: 200,
		color: '#245387',
		name: 'web',
		count: 0,
		rate: 0,
	},
	{
		width: 150,
		color: '#69FAFE',
		name: 'Java',
		count: 0,
		rate: 0,
	},
	{
		width: 100,
		color: '#F15358',
		name: 'C++',
		count: 0,
		rate: 0,
	}
];

 css scss代码如下:


    .content {
        color: #fff;
        width: calc(100% - 40px);
        height: calc(100% - 74px);
        padding: 0 20px 10px;
        position: relative;
        flex: 1;
        &_ {
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;

        }

        /deep/ .el-progress {
            transform: rotate3d(1, 0.4, 0, 180deg);
            position: absolute;
            left: 20px;
        }

        .progress-info {
            display: flex;
            align-items: center;
            position: absolute;
            font-size: 12px;
            height: 20px;
            line-height: 20px;
            width: 50%;
            left: calc(50% - 16px);

            &-line {
                flex: 4;
                height: 1px;
                border-bottom: 1px dashed #ffffff;
            }

            &-label {
                flex: 5;
            }

            &-value {
                flex: 1;
            }

            &-round {
                width: 12px;
                height: 12px;
                border-radius: 50%;
                margin: 0 5px;
            }

            &_0 {
                top: calc(50% - 105px);
            }

            &_1 {
                top: calc(50% - 80px);
            }

            &_2 {
                top: calc(50% - 55px);
            }

        }
        p {
            width: 100px;
            height: 50px;
            font-size: 16px;
            position: absolute;
            left: calc(50% - 85px);
            top: calc(50% - 25px);
            color: #fff;
            line-height: 50px;
            font-weight: bold;
            text-align: center;
        }
    }

效果图如下:

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值