mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-02 12:18:46 +08:00
Rate: Fix decimal display support in disabled mode (#15089)
This commit is contained in:
parent
f02a849444
commit
f19b9f13c6
@ -148,9 +148,8 @@
|
||||
decimalStyle() {
|
||||
let width = '';
|
||||
if (this.rateDisabled) {
|
||||
width = `${ this.valueDecimal < 50 ? 0 : 50 }%`;
|
||||
}
|
||||
if (this.allowHalf) {
|
||||
width = `${ this.valueDecimal }%`;
|
||||
} else if (this.allowHalf) {
|
||||
width = '50%';
|
||||
}
|
||||
return {
|
||||
|
@ -181,7 +181,7 @@ describe('Rate', () => {
|
||||
|
||||
const fourthStar = vm2.$el.querySelectorAll('.el-rate__item')[3];
|
||||
const halfStar = fourthStar.querySelector('.el-rate__decimal');
|
||||
expect(halfStar.style.width).to.equal('0%');
|
||||
expect(halfStar.style.width).to.equal('40%');
|
||||
});
|
||||
|
||||
it('allow half', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user