From 2550ac9111a87a857a96b841ddbf76c3f62869e9 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 14 Nov 2020 06:47:08 +0800 Subject: [PATCH] chore: rename scopedSlots to slots in legacy cases --- src/area/test/index.legacy.js | 2 +- src/calendar/test/index.legacy.js | 2 +- src/card/test/index.legacy.js | 12 ++++++------ src/checkbox/test/index.legacy.js | 4 ++-- src/dialog/test/index.legacy.js | 4 ++-- src/field/test/index.legacy.js | 8 ++++---- src/image/test/index.legacy.js | 2 +- src/list/test/index.legacy.js | 4 ++-- src/loading/test/index.legacy.js | 2 +- src/nav-bar/test/index.legacy.js | 4 ++-- src/number-keyboard/test/index.legacy.js | 4 ++-- src/overlay/test/index.legacy.js | 2 +- src/pagination/test/index.legacy.js | 4 ++-- src/picker/test/index.legacy.js | 2 +- src/pull-refresh/test/index.legacy.js | 4 ++-- src/search/test/index.legacy.js | 6 +++--- src/share-sheet/test/index.legacy.js | 2 +- src/submit-bar/test/index.legacy.js | 4 ++-- src/swipe-cell/test/index.legacy.js | 6 +++--- src/tree-select/test/index.legacy.js | 2 +- src/uploader/test/index.legacy.js | 2 +- 21 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/area/test/index.legacy.js b/src/area/test/index.legacy.js index c6c1f41e1..82f03ad89 100644 --- a/src/area/test/index.legacy.js +++ b/src/area/test/index.legacy.js @@ -125,7 +125,7 @@ test('columns-num prop', async () => { test('title slot', async () => { const wrapper = mount(Area, { - scopedSlots: { + slots: { title: () => 'Custom Title', }, }); diff --git a/src/calendar/test/index.legacy.js b/src/calendar/test/index.legacy.js index 3c4b0727b..c6aa3523f 100644 --- a/src/calendar/test/index.legacy.js +++ b/src/calendar/test/index.legacy.js @@ -302,7 +302,7 @@ test('title & footer slot', async () => { poppable: false, defaultDate: minDate, }, - scopedSlots: { + slots: { title: () => 'Custom Title', footer: () => 'Custom Footer', }, diff --git a/src/card/test/index.legacy.js b/src/card/test/index.legacy.js index c8c04f0ce..efade2d6f 100644 --- a/src/card/test/index.legacy.js +++ b/src/card/test/index.legacy.js @@ -44,7 +44,7 @@ test('click-thumb event', () => { test('render price & num slot', () => { const wrapper = mount(Card, { - scopedSlots: { + slots: { num: () => 'Custom Num', price: () => 'Custom Price', }, @@ -55,7 +55,7 @@ test('render price & num slot', () => { test('render origin-price slot', () => { const wrapper = mount(Card, { - scopedSlots: { + slots: { 'origin-price': () => 'Custom Origin Price', }, }); @@ -65,7 +65,7 @@ test('render origin-price slot', () => { test('render bottom slot', () => { const wrapper = mount(Card, { - scopedSlots: { + slots: { bottom: () => 'Custom Bottom', }, }); @@ -75,7 +75,7 @@ test('render bottom slot', () => { test('render thumb & tag slot', () => { const wrapper = mount(Card, { - scopedSlots: { + slots: { tag: () => 'Custom Tag', thumb: () => 'Custom Thumb', }, @@ -86,7 +86,7 @@ test('render thumb & tag slot', () => { test('render title & desc slot', () => { const wrapper = mount(Card, { - scopedSlots: { + slots: { title: () => 'Custom Title', desc: () => 'Custom desc', }, @@ -97,7 +97,7 @@ test('render title & desc slot', () => { test('render price & price-top slot', () => { const wrapper = mount(Card, { - scopedSlots: { + slots: { price: () => 'Custom Price', 'price-top': () => 'Custom Price-top', }, diff --git a/src/checkbox/test/index.legacy.js b/src/checkbox/test/index.legacy.js index 33e475eeb..58c0b44ba 100644 --- a/src/checkbox/test/index.legacy.js +++ b/src/checkbox/test/index.legacy.js @@ -30,7 +30,7 @@ test('disabled', () => { test('label disabled', () => { const wrapper = mount(Checkbox, { - scopedSlots: { + slots: { default: () => 'Label', }, props: { @@ -93,7 +93,7 @@ test('click event', async () => { test('label-position prop', () => { const wrapper = mount(Checkbox, { - scopedSlots: { + slots: { default: () => 'Label', }, props: { diff --git a/src/dialog/test/index.legacy.js b/src/dialog/test/index.legacy.js index eae15fa13..5925e79a3 100644 --- a/src/dialog/test/index.legacy.js +++ b/src/dialog/test/index.legacy.js @@ -108,7 +108,7 @@ test('default slot', () => { props: { value: true, }, - scopedSlots: { + slots: { default: () => 'Custom Message', }, }); @@ -120,7 +120,7 @@ test('title slot', () => { props: { value: true, }, - scopedSlots: { + slots: { title: () => 'Custom Title', }, }); diff --git a/src/field/test/index.legacy.js b/src/field/test/index.legacy.js index 497b65cfc..9705ea330 100644 --- a/src/field/test/index.legacy.js +++ b/src/field/test/index.legacy.js @@ -26,7 +26,7 @@ test('click-input event', () => { test('click-input event when using input slot', () => { const wrapper = mount(Field, { - scopedSlots: { + slots: { input: () => 'Custom Input', }, }); @@ -224,7 +224,7 @@ test('clear-trigger prop', () => { test('render input slot', () => { const wrapper = mount(Field, { - scopedSlots: { + slots: { input: () => 'Custom Input', }, }); @@ -234,7 +234,7 @@ test('render input slot', () => { test('render label slot', () => { const wrapper = mount(Field, { - scopedSlots: { + slots: { label: () => 'Custom Label', }, }); @@ -244,7 +244,7 @@ test('render label slot', () => { test('render extra slot', () => { const wrapper = mount(Field, { - scopedSlots: { + slots: { extra: () => 'Extra', }, }); diff --git a/src/image/test/index.legacy.js b/src/image/test/index.legacy.js index 66d349b66..10899ad34 100644 --- a/src/image/test/index.legacy.js +++ b/src/image/test/index.legacy.js @@ -188,7 +188,7 @@ test('default slot', () => { props: { src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, - scopedSlots: { + slots: { default: () => 'Custom Default', }, }); diff --git a/src/list/test/index.legacy.js b/src/list/test/index.legacy.js index 0a2982fd7..642628099 100644 --- a/src/list/test/index.legacy.js +++ b/src/list/test/index.legacy.js @@ -75,7 +75,7 @@ test('finished slot', async () => { props: { finished: true, }, - scopedSlots: { + slots: { finished: () => 'Custom Finished', }, }); @@ -88,7 +88,7 @@ test('error slot', async () => { props: { error: true, }, - scopedSlots: { + slots: { error: () => 'Custom Error', }, }); diff --git a/src/loading/test/index.legacy.js b/src/loading/test/index.legacy.js index 4543ed68e..a68d5651c 100644 --- a/src/loading/test/index.legacy.js +++ b/src/loading/test/index.legacy.js @@ -16,7 +16,7 @@ test('text-size prop', () => { props: { textSize: 20, }, - scopedSlots: { + slots: { default: () => 'Text', }, }); diff --git a/src/nav-bar/test/index.legacy.js b/src/nav-bar/test/index.legacy.js index 1f80a87cf..d5c85fa36 100644 --- a/src/nav-bar/test/index.legacy.js +++ b/src/nav-bar/test/index.legacy.js @@ -3,7 +3,7 @@ import { mount, mockGetBoundingClientRect } from '../../../test'; test('should render left/right slot and match snapshot', () => { const wrapper = mount(NavBar, { - scopedSlots: { + slots: { left: () => 'Custom Left', right: () => 'Custom Right', }, @@ -14,7 +14,7 @@ test('should render left/right slot and match snapshot', () => { test('should render title slot and match snapshot', () => { const wrapper = mount(NavBar, { - scopedSlots: { + slots: { title: () => 'Custom Title', }, }); diff --git a/src/number-keyboard/test/index.legacy.js b/src/number-keyboard/test/index.legacy.js index 154dcf037..bcade47c3 100644 --- a/src/number-keyboard/test/index.legacy.js +++ b/src/number-keyboard/test/index.legacy.js @@ -85,7 +85,7 @@ test('render title', () => { test('title-left slot', () => { const wrapper = mount(NumberKeyboard, { - scopedSlots: { + slots: { 'title-left': () => 'Custom Title Left', }, }); @@ -105,7 +105,7 @@ test('extra-key prop', () => { test('extra-key slot', () => { const wrapper = mount(NumberKeyboard, { - scopedSlots: { + slots: { 'extra-key': () => 'Custom Extra Key', }, }); diff --git a/src/overlay/test/index.legacy.js b/src/overlay/test/index.legacy.js index 4264a7a71..bade1a42a 100644 --- a/src/overlay/test/index.legacy.js +++ b/src/overlay/test/index.legacy.js @@ -63,7 +63,7 @@ test('click event', () => { test('default slot', () => { const wrapper = mount(Overlay, { - scopedSlots: { + slots: { default: () => 'Custom Default', }, }); diff --git a/src/pagination/test/index.legacy.js b/src/pagination/test/index.legacy.js index 90e782c6b..ad691e9f0 100644 --- a/src/pagination/test/index.legacy.js +++ b/src/pagination/test/index.legacy.js @@ -7,7 +7,7 @@ test('render prev-text & next-text slot', () => { totalItems: 50, showPageSize: 5, }, - scopedSlots: { + slots: { 'prev-text': () => 'Custom PrevText', 'next-text': () => 'Custom NextText', }, @@ -22,7 +22,7 @@ test('render page slot', () => { totalItems: 50, showPageSize: 5, }, - scopedSlots: { + slots: { page: ({ text }) => `${text}`, }, }); diff --git a/src/picker/test/index.legacy.js b/src/picker/test/index.legacy.js index bea5ae3a8..c3369ddda 100644 --- a/src/picker/test/index.legacy.js +++ b/src/picker/test/index.legacy.js @@ -261,7 +261,7 @@ test('columns-top、columns-bottom prop', () => { props: { showToolbar: true, }, - scopedSlots: { + slots: { 'columns-top': () => 'Custom Columns Top', 'columns-bottom': () => 'Custom Columns Bottom', }, diff --git a/src/pull-refresh/test/index.legacy.js b/src/pull-refresh/test/index.legacy.js index e2ba94720..a4007aa21 100644 --- a/src/pull-refresh/test/index.legacy.js +++ b/src/pull-refresh/test/index.legacy.js @@ -45,7 +45,7 @@ test('change head content when pulling down', async () => { test('custom content by slots', async () => { const wrapper = mount(PullRefresh, { - scopedSlots: { + slots: { pulling({ distance }) { return `pulling ${distance}`; }, @@ -137,7 +137,7 @@ test('render success text', async () => { test('render success slot', async () => { const wrapper = mount(PullRefresh, { - scopedSlots: { + slots: { success: () => 'Custom Success', }, listeners: { diff --git a/src/search/test/index.legacy.js b/src/search/test/index.legacy.js index ef887251f..c41525ded 100644 --- a/src/search/test/index.legacy.js +++ b/src/search/test/index.legacy.js @@ -65,7 +65,7 @@ test('search event', () => { test('label slot', () => { const wrapper = mount(Search, { - scopedSlots: { + slots: { label: () => 'Custom Label', }, }); @@ -75,7 +75,7 @@ test('label slot', () => { test('left slot', () => { const wrapper = mount(Search, { - scopedSlots: { + slots: { left: () => 'Custom Left Content', }, }); @@ -105,7 +105,7 @@ test('right-icon prop', () => { test('right-icon slot', () => { const wrapper = mount(Search, { - scopedSlots: { + slots: { 'right-icon': () => 'Custom Right Icon', }, }); diff --git a/src/share-sheet/test/index.legacy.js b/src/share-sheet/test/index.legacy.js index e415a96bf..0a89e7bf3 100644 --- a/src/share-sheet/test/index.legacy.js +++ b/src/share-sheet/test/index.legacy.js @@ -75,7 +75,7 @@ test('title & description slot', () => { props: { value: true, }, - scopedSlots: { + slots: { title: () => 'Custom Title', description: () => 'Custom Description', }, diff --git a/src/submit-bar/test/index.legacy.js b/src/submit-bar/test/index.legacy.js index 73cdd5693..9905a19a6 100644 --- a/src/submit-bar/test/index.legacy.js +++ b/src/submit-bar/test/index.legacy.js @@ -51,7 +51,7 @@ test('without price', () => { test('top slot', () => { const wrapper = mount(SubmitBar, { - scopedSlots: { + slots: { top: () => 'Custom Top', }, }); @@ -123,7 +123,7 @@ test('button-color prop', () => { test('button slot', () => { const wrapper = mount(SubmitBar, { buttonText: 'text', - scopedSlots: { + slots: { button: () => 'Custom button', }, }); diff --git a/src/swipe-cell/test/index.legacy.js b/src/swipe-cell/test/index.legacy.js index 1695d23e8..4e4fe6fca 100644 --- a/src/swipe-cell/test/index.legacy.js +++ b/src/swipe-cell/test/index.legacy.js @@ -12,7 +12,7 @@ const defaultProps = { leftWidth: 100, rightWidth: 100, }, - scopedSlots: { + slots: { left: () => 'Left', right: () => 'Right', }, @@ -120,7 +120,7 @@ test('auto calc width', async () => { }); const wrapper = mount(SwipeCell, { - scopedSlots: defaultProps.scopedSlots, + slots: defaultProps.scopedSlots, }); await later(); @@ -136,7 +136,7 @@ test('render one side', async () => { }); const wrapper = mount(SwipeCell, { - scopedSlots: { + slots: { left: defaultProps.scopedSlots.left, }, }); diff --git a/src/tree-select/test/index.legacy.js b/src/tree-select/test/index.legacy.js index 567c04955..a39c26b68 100644 --- a/src/tree-select/test/index.legacy.js +++ b/src/tree-select/test/index.legacy.js @@ -127,7 +127,7 @@ test('content slot', () => { }, ], }, - scopedSlots: { + slots: { content: () => 'Custom Content', }, }); diff --git a/src/uploader/test/index.legacy.js b/src/uploader/test/index.legacy.js index 32ca85109..c42e0a396 100644 --- a/src/uploader/test/index.legacy.js +++ b/src/uploader/test/index.legacy.js @@ -530,7 +530,7 @@ test('preview-cover slot', () => { props: { fileList: [{ url: IMAGE }, { url: IMAGE }], }, - scopedSlots: { + slots: { 'preview-cover': (item) => `url: ${item.url}, index: ${item.index}`, }, });