commit:同步2.3版本

This commit is contained in:
Jerry
2022-02-20 13:40:36 +08:00
parent c7cc3f5354
commit cbe0f7947d
668 changed files with 172592 additions and 821 deletions

View File

@@ -0,0 +1,44 @@
<template>
<el-progress v-bind="$attrs" :percentage="getPercentage" />
</template>
<script>
export default {
name: 'Progress',
props: {
/**
* 组件最小值
*/
min: {
type: Number,
default: 0
},
/**
* 组件最大值
*/
max: {
type: Number,
default: 100
},
/**
* 组件当前值
*/
value: {
type: Number,
default: 0
}
},
computed: {
getPercentage () {
let value = Math.min(this.max, Math.max(this.min, this.value));
value = value - this.min;
if ((this.max - this.min) === 0) {
value = 0;
} else {
value = ((value * 100) / (this.max - this.min));
}
return Number.isInteger(value) ? value : parseInt(value);
}
}
}
</script>