效果图:
代码:
<el-progress
stroke-width="4"
type="line"
:percentage="91.23"
class="custom-progress"
color="transparent"
>
<template #default="{ percentage }">
<div class="progress-label">{{ percentage }}%</div>
</template>
</el-progress>
样式代码:
.custom-progress {
position: relative;
width: 300px; /* 设置进度条的宽度 */
background: transparent;
}
// 进度条颜色渐变
:deep(.custom-progress .el-progress-bar__inner) {
background-image: linear-gradient(
to right,
rgba(0, 120, 255, 0.1),
rgba(0, 160, 255, 1)
);
}
标签:el,进度条,custom,rgba,progress,255
From: https://blog.csdn.net/lingodeer/article/details/143436765