Commit f19b9f13 authored by Haoran Yu's avatar Haoran Yu Committed by hetech

Rate: Fix decimal display support in disabled mode (#15089)

parent f02a8494
...@@ -148,9 +148,8 @@ ...@@ -148,9 +148,8 @@
decimalStyle() { decimalStyle() {
let width = ''; let width = '';
if (this.rateDisabled) { if (this.rateDisabled) {
width = `${ this.valueDecimal < 50 ? 0 : 50 }%`; width = `${ this.valueDecimal }%`;
} } else if (this.allowHalf) {
if (this.allowHalf) {
width = '50%'; width = '50%';
} }
return { return {
......
...@@ -181,7 +181,7 @@ describe('Rate', () => { ...@@ -181,7 +181,7 @@ describe('Rate', () => {
const fourthStar = vm2.$el.querySelectorAll('.el-rate__item')[3]; const fourthStar = vm2.$el.querySelectorAll('.el-rate__item')[3];
const halfStar = fourthStar.querySelector('.el-rate__decimal'); const halfStar = fourthStar.querySelector('.el-rate__decimal');
expect(halfStar.style.width).to.equal('0%'); expect(halfStar.style.width).to.equal('40%');
}); });
it('allow half', () => { it('allow half', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment