chore: prefer nullish coalescing (#7125)

This commit is contained in:
neverland
2020-09-07 20:36:49 +08:00
committed by GitHub
parent c7303786ae
commit 4ffa6ead1e
15 changed files with 27 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
import { createNamespace, isDef, addUnit } from '../utils';
import { createNamespace, addUnit } from '../utils';
const [createComponent, bem] = createNamespace('progress');
@@ -49,7 +49,7 @@ export default createComponent({
render() {
const { pivotText, percentage } = this;
const text = isDef(pivotText) ? pivotText : percentage + '%';
const text = pivotText ?? percentage + '%';
const showPivot = this.showPivot && text;
const background = this.inactive ? '#cacaca' : this.color;