add vertical progressbar
This commit is contained in:
parent
7f08fb512a
commit
48921bf57d
3 changed files with 39 additions and 2 deletions
|
@ -10,6 +10,11 @@
|
||||||
<Icon type="checkmark-circled"></Icon>
|
<Icon type="checkmark-circled"></Icon>
|
||||||
<span>成功</span>
|
<span>成功</span>
|
||||||
</i-progress>
|
</i-progress>
|
||||||
|
<i-progress :percent="percent"></i-progress>
|
||||||
|
<div style="height: 150px">
|
||||||
|
<i-progress vertical :percent="percent" :stroke-width="20" hide-info></i-progress>
|
||||||
|
<i-progress vertical :percent="percent"></i-progress>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -43,6 +43,10 @@
|
||||||
strokeWidth: {
|
strokeWidth: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 10
|
default: 10
|
||||||
|
},
|
||||||
|
vertical: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
@ -68,7 +72,10 @@
|
||||||
return type;
|
return type;
|
||||||
},
|
},
|
||||||
bgStyle () {
|
bgStyle () {
|
||||||
return {
|
return this.vertical ? {
|
||||||
|
height: `${this.percent}%`,
|
||||||
|
width: `${this.strokeWidth}px`
|
||||||
|
} : {
|
||||||
width: `${this.percent}%`,
|
width: `${this.percent}%`,
|
||||||
height: `${this.strokeWidth}px`
|
height: `${this.strokeWidth}px`
|
||||||
};
|
};
|
||||||
|
@ -78,7 +85,8 @@
|
||||||
`${prefixCls}`,
|
`${prefixCls}`,
|
||||||
`${prefixCls}-${this.currentStatus}`,
|
`${prefixCls}-${this.currentStatus}`,
|
||||||
{
|
{
|
||||||
[`${prefixCls}-show-info`]: !this.hideInfo
|
[`${prefixCls}-show-info`]: !this.hideInfo,
|
||||||
|
[`${prefixCls}-vertical`]: this.vertical
|
||||||
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,7 +2,13 @@
|
||||||
|
|
||||||
.@{progress-prefix-cls} {
|
.@{progress-prefix-cls} {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
&-vertical {
|
||||||
|
height: 100%;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
font-size: @font-size-small;
|
font-size: @font-size-small;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@ -17,6 +23,10 @@
|
||||||
margin-right: -55px;
|
margin-right: -55px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&-vertical &-outer {
|
||||||
|
height: 100%;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
&-inner {
|
&-inner {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -25,6 +35,20 @@
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
&-vertical &-inner {
|
||||||
|
height: 100%;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
& > *, &:after {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&-bg {
|
&-bg {
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
|
|
Loading…
Add table
Reference in a new issue