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
+2 -2
View File
@@ -10,7 +10,7 @@ import SkuRowPropItem from './components/SkuRowPropItem';
import SkuStepper from './components/SkuStepper';
import SkuMessages from './components/SkuMessages';
import SkuActions from './components/SkuActions';
import { createNamespace, isDef } from '../utils';
import { createNamespace } from '../utils';
import {
isAllSelected,
isSkuChoosable,
@@ -361,7 +361,7 @@ export default createComponent({
resetStepper() {
const { skuStepper } = this.$refs;
const { selectedNum } = this.initialSku;
const num = isDef(selectedNum) ? selectedNum : this.startSaleNum;
const num = selectedNum ?? this.startSaleNum;
// 用来缓存不合法的情况
this.stepperError = null;