Progress进度条

用于展示操作进度,告知用户当前状态和预期。

线形进度条

Progress组件设置 percentage属性即可,表示进度调对应的百分比,必填,必须在0~100。通过format属性指定进度调文字内容。

<el-progress :percentage="50"></el-progress>
<el-progress :percentage="100" :format="format"></el-progress>
<el-progress :percentage="100" status="success"></el-progress>
<el-progress :percentage="100" status="warning"></el-progress>
<el-progress :percentage="50" status="exception"></el-progress><script>export default {methods: {format(percentage) {return percentage === 100 ? '满' : `${percentage}%`;}}};
</script>

效果图如下所示:

百分比内显

Progress组件可通过 stroke-width属性更改进度条的高度,并可通过 text-inside属性来将进度条描述置于进度条内部。

<el-progress :text-inside="true" :stroke-width="26" :percentage="70"></el-progress>
<el-progress :text-inside="true" :stroke-width="24" :percentage="100" status="success"></el-progress>
<el-progress :text-inside="true" :stroke-width="22" :percentage="80" status="warning"></el-progress>
<el-progress :text-inside="true" :stroke-width="20" :percentage="50" status="exception"></el-progress>

效果图如下所示:

自定义颜色

可以通过color设置进度条的颜色,color可以接受颜色字符串,函数和数组。

<el-progress :percentage="percentage" :color="customColor"></el-progress><el-progress :percentage="percentage" :color="customColorMethod"></el-progress><el-progress :percentage="percentage" :color="customColors"></el-progress>
<div><el-button-group><el-button icon="el-icon-minus" @click="decrease"></el-button><el-button icon="el-icon-plus" @click="increase"></el-button></el-button-group>
</div><script>export default {data() {return {percentage: 20,customColor: '#409eff',customColors: [{color: '#f56c6c', percentage: 20},{color: '#e6a23c', percentage: 40},{color: '#5cb87a', percentage: 60},{color: '#1989fa', percentage: 80},{color: '#6f7ad3', percentage: 100}]};},methods: {customColorMethod(percentage) {if (percentage < 30) {return '#909399';} else if (percentage < 70) {return '#e6a23c';} else {return '#67c23a';}},increase() {this.percentage += 10;if (this.percentage > 100) {this.percentage = 100;}},decrease() {this.percentage -= 10;if (this.percentage < 0) {this.percentage = 0;}}}}
</script>

效果图如下所示:

环形进度条

Progress组件可通过type属性来指定使用环形进度条,在环形进度条中,还可以通过width属性设置其大小。

<el-progress type="circle" :percentage="0"></el-progress>
<el-progress type="circle" :percentage="25"></el-progress>
<el-progress type="circle" :percentage="100" status="success"></el-progress>
<el-progress type="circle" :percentage="70" status="warning"></el-progress>
<el-progress type="circle" :percentage="50" status="exception"></el-progress>

效果图如下所示:

仪表盘形进度条

通过type属性来指定使用仪表盘形进度条。

<el-progress type="dashboard" :percentage="percentage" :color="colors"></el-progress>
<div><el-button-group><el-button icon="el-icon-minus" @click="decrease"></el-button><el-button icon="el-icon-plus" @click="increase"></el-button></el-button-group>
</div><script>export default {data() {return {percentage: 10,colors: [{color: '#f56c6c', percentage: 20},{color: '#e6a23c', percentage: 40},{color: '#5cb87a', percentage: 60},{color: '#1989fa', percentage: 80},{color: '#6f7ad3', percentage: 100}]};},methods: {increase() {this.percentage += 10;if (this.percentage > 100) {this.percentage = 100;}},decrease() {this.percentage -= 10;if (this.percentage < 0) {this.percentage = 0;}}}}
</script>

效果图如下所示:

Attributes

参数 说明 类型 可选值 默认值
 percentage 百分比(必填) number 0-100 0
type 进度条类型 string line/circle/dashboard line
 stroke-width 进度条的宽度,单位px nubmer —— 0
 text-inside 进度条显示文字内置在进度条内(只在type=line时可用) boolean —— false
status 进度条当前状态 string success/exception/warning ——
color 进度条背景色(会覆盖status状态颜色) string/function/array —— “”
width 环形进度条画布宽度(只在type为circle或 dashboard时可用) number   126
show-text 是否显示进度条文字内容 boolean —— true
stroke-linecap circle/dashboard string butt/round/square round

Progress进度条相关推荐

  1. 微信小程序进度条样式_微信小程序组件progress进度条解读和分析

    progress进度条组件说明: 进度条,就是表示事情当前完成到什么地步了,可以让用户视觉上感知事情的执行. progress进度条是微信小程序的组件,和HTML5的进度条progress类似. pr ...

  2. linux dd 进度条,Progress 进度条 – DDProgressHUD

    DDProgressHUD Progress 进度条,UIActivityIndicatorView 小菊花,弹窗,状态显示,高度自定义 DDProgressHUD的介绍 提供了四种类型的展示: 显示 ...

  3. 微信小程序 MinUI 组件库系列之 progress 进度条组件

    MinUI 是基于微信小程序自定义组件特性开发而成的一套简洁.易用.高效的组件库,适用场景广,覆盖小程序原生框架.各种小程序组件主流框架等,并且提供了高效的命令行工具.MinUI 组件库包含了很多基础 ...

  4. html进度条实现原理,HTML5 progress进度条详解

    HTML5 progress 元素简介 progress是HTML5的一个新元素,表示定义一个进度条,用途很广泛,可以用在文件上传的进度显示,文件下载的进度显示,也可以作为一种loading的加载状态 ...

  5. elementui进度条如何设置_ElementUI之Progress进度条底色设置

    ElementUI中Progress进度条组件官网给了如下属性: 这里的color很好理解就是显示实际进度的颜色(个人觉得叫背景色不太好).但是官网并没有给出设置底色的属性,只给了一个默认的颜色,F1 ...

  6. 直播平台搭建源码,uniapp progress进度条

    直播平台搭建源码,uniapp progress进度条 .progress-container {height: 20rpx;display: flex;flex-direction: row;ali ...

  7. 微信小程序组件解读和分析:六、progress进度条

    progress进度条组件说明: 进度条,就是表示事情当前完成到什么地步了,可以让用户视觉上感知事情的执行. progress进度条是微信小程序的组件,和HTML5的进度条progress类似. pr ...

  8. Flutter进度条Flutter圆形进度条Flutter条形进度条Flutter Progress进度条LinearProgressIndicator

    更多文章请查看 flutter从入门 到精通 Flutter Progress 1 条形无固定值进度条 //LinearProgressIndicator不具备设置高度的选项,可以使用SizedBox ...

  9. bootstrap3的 progress 进度条

    : 2.3版               3.0版 .bar .progress-bar .bar-* .progress-bar-* 2.代码: [html] view plaincopy < ...

  10. 微信小程序进度条样式_微信小程序—progress(进度条)

    设置进度条颜色(请使用十六进制颜色值,例如:#ff00ff) 未选择的进度条的颜色(请使用十六进制颜色值,例如:#ff00ff) 设置/取消进度条从左往右的动画 设置/取消进度条右侧显示百分比 //获 ...

最新文章

  1. 在ASP.NET中自动给URL地址加上超链接
  2. angularjs 让当前路由重新加载_Vuerouter(路由)
  3. 2009第二届C++技术大会即将在上海隆重召开
  4. 海康摄像头的二次开发(java)
  5. 【TP3.2】模板 select选项采坑
  6. linux定时运行命令脚本——crontab
  7. dubbo源码解析-zookeeper创建节点
  8. Linux20180502 六周第四次课(5月2日)
  9. HTTP请求头和响应头部包括的信息有哪些?(转)
  10. UI数据缓冲层的设计(-)
  11. 美媒:中国可能引领“物联网”的进步
  12. 如何查看opencv版本
  13. QtAV的编译与使用(MSVC2015+Qt5.9.8)
  14. Flink编程中遇到”scala.tools.reflect.ToolBoxError: reflective compilation has failed“的解决方法
  15. [KMP]P3426
  16. 习题8-7 字符串排序 (20分)
  17. 关于tp-link wr740 v4的刷机救砖的办法(非线刷解决)恢复原版的
  18. 支付宝、微信、银联移动支付集成
  19. 手动安装chrome插件
  20. 【学习记录-R】以U检验为例解释单/双侧检验

热门文章

  1. java微信刷卡支付demo,微信刷卡支付API详解
  2. java der格式_读取DER格式java中的私钥
  3. 密码学系列 - DER编码
  4. mac tortoisesvn客户端_TortoiseSVN Mac版
  5. pb公共变量怎么找_pb 实用方法
  6. html自动定时弹窗,html网页弹窗代码 setinterval 定时任务啊
  7. zz我们都回不去了-南大校门被拆
  8. mac brew命令汇总
  9. 此操作系统不支持.netframework4.7.1
  10. miflash刷机:fastboot模式/保留数据刷机