W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
用于展示操作進度,告知用戶當前狀態(tài)和預期。
Progress 組件設(shè)置percentage
屬性即可,表示進度條對應的百分比,必填,必須在 0-100。
render() {
return (
<div>
<Progress percentage={0} />
<Progress percentage={70} />
<Progress percentage={100} status="success" />
<Progress percentage={50} status="exception" />
</div>
)
}
百分比不占用額外控件,適用于文件上傳等場景。
Progress 組件可通過 strokeWidth
屬性更改進度條的高度,并可通過 textInside
屬性來將進度條描述置于進度條內(nèi)部。
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
屬性來指定使用環(huán)形進度條,在環(huán)形進度條中,還可以通過 width
屬性來設(shè)置其大小。
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>
)
}
參數(shù) | 說明 | 類型 | 可選值 | 默認值 |
---|---|---|---|---|
percentage | 百分比(必填) | number | 0-100 | 0 |
type | 進度條類型 | string | line/circle | line |
strokeWidth | 進度條的寬度,單位 px | number | — | 6 |
textInside | 進度條顯示文字內(nèi)置在進度條內(nèi)(只在 type=line 時可用) | Boolean | — | false |
status | 進度條當前狀態(tài) | string | success/exception | — |
width | 環(huán)形進度條畫布寬度(只在 type=circle 時可用) | number | 126 | |
showText | 是否顯示進度條文字內(nèi)容 | boolean | — | true |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: