mirror of
https://github.com/youzan/vant.git
synced 2026-01-22 01:02:23 +08:00
chore: prefer nullish coalescing (#7125)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user