默认样式:
我想要的效果:
- 进度条的宽度、高度自定义
- 颜色自定义
- 底色自定义
- 百分比样式自定义
官方属性:
比较常用的就是:
- text-inside 控制百分比在进度条里(只有是type=line时有效)
- percentage 百分比数值,整数
this.ylUsage = parseInt(this.usageRate.ylUsage)
- stroke-width:进度条宽度(粗细),官方例子20、22、24、26
<el-progress style="width: 100%;" class="el-progress__text" :stroke-width="20" :percentage="ylUsage" />
<style lang="scss" scoped>
// 百分比样式
::v-deep .el-progress__text {
color: #808080;
margin-left: 15px;
}
::v-deep .el-progress {
margin-left: 0;
}
// 百进度条底色
::v-deep .el-progress-bar__outer {
background-color: rgba(0, 0, 0, 0.15);
}
// 百进度条颜色
::v-deep .el-progress-bar__inner {
background-color: #5f86b2;
}
最后长这样啦