Element-React Progress 进度条

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

线形进度条 — 百分比外显

Progress 组件设置percentage属性即可,表示进度条对应的百分比,必填,必须在 0-100。

Element-React Progress 进度条

render() {
  return (
    <div>
      <Progress percentage={0} />
      <Progress percentage={70} />
      <Progress percentage={100} status="success" />
      <Progress percentage={50} status="exception" />
    </div>
  )
}

线形进度条 — 百分比内显

百分比不占用额外控件,适用于文件上传等场景。

Progress 组件可通过 strokeWidth 属性更改进度条的高度,并可通过 textInside 属性来将进度条描述置于进度条内部。
Element-React Progress 进度条

render() {
  return (
    <div>
      <Progress strokeWidth={18} percentage={0} textInside />
      <Progress strokeWidth={18} percentage={70} textInside />
      <Progress strokeWidth={18} percentage={100} status="success" textInside />
      <Progress strokeWidth={18} percentage={50} status="exception" textInside />
    </div>
  )
}

环形进度条

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

Element-React Progress 进度条

render() {
  return (
    <div>
      <Progress type="circle" percentage={0} />
      <Progress type="circle" percentage={25} />
      <Progress type="circle" percentage={100} status="success" />
      <Progress type="circle" percentage={50} status="exception" />
    </div>
  )
}

Attributes

参数说明类型可选值默认值
percentage百分比(必填)number0-1000
type进度条类型stringline/circleline
strokeWidth进度条的宽度,单位 pxnumber6
textInside进度条显示文字内置在进度条内(只在 type=line 时可用)Booleanfalse
status进度条当前状态stringsuccess/exception
width环形进度条画布宽度(只在 type=circle 时可用)number126
showText是否显示进度条文字内容booleantrue

作者:andy,如若转载,请注明出处:https://www.web176.com/elementreact/19987.html

(0)
打赏 支付宝 支付宝 微信 微信
andy的头像andy
上一篇 2023年5月11日
下一篇 2023年5月11日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注