[improvement] Use scoped-slots in Vue 2.6+ (#2688)
This commit is contained in:
+2
-2
@@ -9,9 +9,9 @@ import SkuRowItem from './components/SkuRowItem';
|
||||
import SkuStepper from './components/SkuStepper';
|
||||
import SkuMessages from './components/SkuMessages';
|
||||
import SkuActions from './components/SkuActions';
|
||||
import { use } from '../utils';
|
||||
import { isAllSelected, isSkuChoosable, getSkuComb, getSelectedSkuValues } from './utils/skuHelper';
|
||||
import { LIMIT_TYPE, UNSELECTED_SKU_VALUE_ID } from './constants';
|
||||
import { use, useSlots } from '../utils';
|
||||
|
||||
const [sfc] = use('sku');
|
||||
const { QUOTA_LIMIT } = LIMIT_TYPE;
|
||||
@@ -367,7 +367,7 @@ export default sfc({
|
||||
selectedSku,
|
||||
selectedSkuComb
|
||||
};
|
||||
const slots = name => useSlots(this)(name, slotsProps);
|
||||
const slots = name => this.slots(name, slotsProps);
|
||||
|
||||
const Header = slots('sku-header') || (
|
||||
<SkuHeader sku={sku} goods={goods} skuEventBus={skuEventBus} selectedSku={selectedSku}>
|
||||
|
||||
@@ -46,7 +46,7 @@ export default sfc({
|
||||
</div>
|
||||
<div class={bem('goods-info')}>
|
||||
<div class="van-sku__goods-name van-ellipsis">{this.goods.title}</div>
|
||||
{this.$slots.default}
|
||||
{this.slots()}
|
||||
<Icon
|
||||
name="close"
|
||||
class="van-sku__close-icon"
|
||||
|
||||
@@ -11,7 +11,7 @@ export default sfc({
|
||||
return (
|
||||
<div class={bem()}>
|
||||
<div class={bem('title')}>{this.skuRow.k}:</div>
|
||||
{this.$slots.default}
|
||||
{this.slots()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user