From 1381070a12ffaa0c9fa1d69de76bc0c62f2c0bc3 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 9 Mar 2021 15:39:26 +0800 Subject: [PATCH] chore: prefer named exports (#8315) * chore: prefer named exports * chore: fix import --- src/action-bar-button/ActionBarButton.tsx | 2 +- src/action-bar-button/test/index.spec.ts | 2 +- src/action-bar-icon/ActionBarIcon.tsx | 4 ++-- src/action-bar-icon/test/index.spec.ts | 2 +- src/action-bar/demo/index.vue | 2 +- src/action-bar/test/index.spec.ts | 2 +- src/action-sheet/ActionSheet.tsx | 6 +++--- src/action-sheet/demo/index.vue | 2 +- src/action-sheet/test/index.spec.ts | 2 +- src/address-edit/AddressEdit.tsx | 16 ++++++++-------- src/address-edit/AddressEditDetail.tsx | 4 ++-- src/address-edit/demo/index.vue | 4 ++-- src/address-edit/test/index.spec.js | 4 ++-- src/address-list/AddressList.tsx | 6 +++--- src/address-list/AddressListItem.tsx | 8 ++++---- src/address-list/demo/index.vue | 2 +- src/address-list/test/index.spec.ts | 2 +- src/area/Area.tsx | 2 +- src/area/demo/area-en.ts | 2 +- src/area/demo/area-simple.ts | 2 +- src/area/demo/area.ts | 2 +- src/area/demo/index.vue | 8 ++++---- src/area/test/index.spec.js | 4 ++-- src/badge/test/index.spec.ts | 2 +- src/button/Button.tsx | 4 ++-- src/button/test/index.spec.ts | 2 +- src/calendar/Calendar.tsx | 6 +++--- src/calendar/test/index.legacy.js | 2 +- src/calendar/test/index.spec.js | 2 +- src/calendar/test/prop.legacy.js | 2 +- src/card/Card.tsx | 4 ++-- src/card/test/index.spec.ts | 2 +- src/cascader/Cascader.tsx | 6 +++--- src/cascader/test/index.spec.ts | 3 +-- src/cell-group/test/index.spec.ts | 2 +- src/cell/Cell.tsx | 2 +- src/cell/test/index.spec.ts | 2 +- src/checkbox-group/test/index.spec.tsx | 4 ++-- src/checkbox/Checker.tsx | 2 +- src/checkbox/test/index.spec.ts | 2 +- src/circle/test/index.spec.ts | 2 +- src/col/test/index.spec.tsx | 4 ++-- src/collapse-item/CollapseItem.tsx | 2 +- src/collapse/test/index.spec.tsx | 4 ++-- src/contact-card/ContactCard.tsx | 2 +- src/contact-card/demo/index.vue | 2 +- src/contact-card/test/index.spec.ts | 2 +- src/contact-edit/ContactEdit.tsx | 12 ++++++------ src/contact-edit/demo/index.vue | 2 +- src/contact-edit/test/index.spec.ts | 2 +- src/contact-list/ContactList.tsx | 12 ++++++------ src/contact-list/demo/index.vue | 2 +- src/contact-list/test/index.spec.ts | 2 +- src/count-down/demo/index.vue | 2 +- src/count-down/test/index.spec.js | 2 +- src/coupon-cell/CouponCell.tsx | 8 ++++++-- src/coupon-cell/test/index.spec.ts | 2 +- src/coupon-list/CouponList.tsx | 10 +++++----- src/coupon-list/demo/index.vue | 2 +- src/coupon-list/test/index.spec.ts | 2 +- src/coupon/Coupon.tsx | 2 +- src/coupon/test/index.spec.ts | 2 +- src/datetime-picker/DatePicker.tsx | 2 +- src/datetime-picker/TimePicker.tsx | 2 +- .../test/datetime-picker.legacy.js | 2 +- src/dialog/Dialog.tsx | 10 +++++----- src/dialog/demo/index.vue | 2 +- src/dialog/test/funciton-call.spec.js | 2 +- src/dropdown-item/DropdownItem.tsx | 6 +++--- src/empty/test/index.spec.ts | 2 +- src/field/Field.tsx | 4 ++-- src/field/test/index.spec.js | 2 +- src/form/demo/FieldTypeArea.vue | 8 ++++---- src/form/demo/ValidateRules.vue | 2 +- src/grid-item/GridItem.tsx | 4 ++-- src/grid/test/index.spec.js | 4 ++-- src/icon/Icon.tsx | 2 +- src/icon/demo/index.vue | 2 +- src/icon/test/index.spec.js | 2 +- src/image-preview/ImagePreview.tsx | 6 +++--- src/image-preview/ImagePreviewItem.tsx | 8 ++++---- src/image-preview/demo/index.vue | 4 ++-- src/image-preview/test/function.spec.ts | 2 +- src/image-preview/test/index.spec.ts | 8 ++++---- src/image/Image.tsx | 5 ++++- src/image/test/index.spec.ts | 2 +- src/index-bar/test/index.spec.js | 6 +++--- src/lazyload/index.ts | 1 + src/list/List.tsx | 2 +- src/list/test/index.spec.js | 2 +- src/loading/test/index.spec.ts | 2 +- src/nav-bar/NavBar.tsx | 2 +- src/nav-bar/demo/index.vue | 2 +- src/nav-bar/test/index.spec.ts | 2 +- src/notice-bar/NoticeBar.tsx | 4 +++- src/notice-bar/test/index.spec.tsx | 2 +- src/notify/Notify.tsx | 2 +- src/notify/demo/index.vue | 2 +- src/notify/test/index.spec.js | 4 ++-- src/number-keyboard/NumberKeyboardKey.tsx | 2 +- src/number-keyboard/demo/index.vue | 2 +- src/number-keyboard/test/index.spec.ts | 2 +- src/overlay/test/index.spec.tsx | 2 +- src/pagination/test/index.spec.ts | 6 +++--- src/password-input/test/index.spec.ts | 2 +- src/picker/Picker.tsx | 2 +- src/picker/demo/index.vue | 2 +- src/picker/test/cascade.legacy.js | 2 +- src/picker/test/index.spec.tsx | 4 ++-- src/popover/Popover.tsx | 4 ++-- src/popover/demo/index.vue | 2 +- src/popover/test/index.spec.tsx | 2 +- src/popup/Popup.tsx | 4 ++-- src/popup/test/index.spec.js | 2 +- src/progress/test/index.spec.ts | 2 +- src/pull-refresh/PullRefresh.tsx | 2 +- src/pull-refresh/demo/index.vue | 2 +- src/pull-refresh/test/index.spec.ts | 2 +- src/radio-group/test/index.spec.tsx | 4 ++-- src/radio/test/index.spec.ts | 2 +- src/rate/Rate.tsx | 2 +- src/rate/demo/index.vue | 2 +- src/rate/test/index.spec.ts | 2 +- src/search/Search.tsx | 2 +- src/search/demo/index.vue | 2 +- src/search/test/index.spec.ts | 2 +- src/share-sheet/ShareSheet.tsx | 4 ++-- src/share-sheet/demo/index.vue | 2 +- src/share-sheet/test/index.spec.ts | 2 +- src/sidebar-item/SidebarItem.tsx | 2 +- src/sidebar/demo/index.vue | 2 +- src/sidebar/test/index.spec.tsx | 4 ++-- src/skeleton/test/index.spec.tsx | 2 +- src/slider/demo/index.vue | 2 +- src/slider/test/index.spec.ts | 2 +- src/step/Step.tsx | 2 +- src/stepper/demo/index.vue | 2 +- src/stepper/test/index.spec.ts | 2 +- src/steps/test/index.spec.tsx | 4 ++-- src/sticky/test/index.spec.js | 2 +- src/submit-bar/SubmitBar.tsx | 4 ++-- src/submit-bar/demo/index.vue | 2 +- src/submit-bar/test/index.spec.ts | 2 +- src/swipe-cell/demo/index.vue | 2 +- src/swipe-cell/test/index.spec.js | 4 ++-- src/swipe/demo/index.vue | 2 +- src/swipe/test/index.spec.js | 4 ++-- src/switch/Switch.tsx | 2 +- src/switch/demo/index.vue | 2 +- src/switch/test/index.spec.ts | 2 +- src/tab/Tab.tsx | 2 +- src/tab/demo/index.vue | 2 +- src/tab/test/index.legacy.js | 2 +- src/tab/test/insert.spec.js | 4 ++-- src/tabbar-item/TabbarItem.tsx | 4 ++-- src/tabbar/demo/index.vue | 2 +- src/tabbar/test/index.spec.tsx | 4 ++-- src/tabs/Tabs.tsx | 2 +- src/tabs/TabsContent.tsx | 2 +- src/tabs/TabsTitle.tsx | 2 +- src/tag/Tag.tsx | 2 +- src/tag/test/index.spec.ts | 2 +- src/toast/Toast.tsx | 6 +++--- src/toast/demo/index.vue | 2 +- src/toast/test/index.legacy.js | 2 +- src/tree-select/TreeSelect.tsx | 6 +++--- src/tree-select/test/index.legacy.js | 2 +- src/uploader/Uploader.tsx | 4 ++-- src/uploader/UploaderPreviewItem.tsx | 6 +++--- src/uploader/demo/index.vue | 2 +- src/uploader/test/index.legacy.js | 2 +- 171 files changed, 272 insertions(+), 263 deletions(-) diff --git a/src/action-bar-button/ActionBarButton.tsx b/src/action-bar-button/ActionBarButton.tsx index 1ea9c26a8..ffa3edbcf 100644 --- a/src/action-bar-button/ActionBarButton.tsx +++ b/src/action-bar-button/ActionBarButton.tsx @@ -8,7 +8,7 @@ import { useExpose } from '../composables/use-expose'; import { useRoute, routeProps } from '../composables/use-route'; // Components -import Button, { ButtonType } from '../button'; +import { Button, ButtonType } from '../button'; const [name, bem] = createNamespace('action-bar-button'); diff --git a/src/action-bar-button/test/index.spec.ts b/src/action-bar-button/test/index.spec.ts index 2a0a20fc0..e6f76ddfa 100644 --- a/src/action-bar-button/test/index.spec.ts +++ b/src/action-bar-button/test/index.spec.ts @@ -1,5 +1,5 @@ import { mount } from '../../../test'; -import ActionBarButton from '..'; +import { ActionBarButton } from '..'; test('should render default slot correctly', () => { const wrapper = mount(ActionBarButton, { diff --git a/src/action-bar-icon/ActionBarIcon.tsx b/src/action-bar-icon/ActionBarIcon.tsx index ae035671c..17f3cef19 100644 --- a/src/action-bar-icon/ActionBarIcon.tsx +++ b/src/action-bar-icon/ActionBarIcon.tsx @@ -7,8 +7,8 @@ import { useParent } from '@vant/use'; import { useRoute, routeProps } from '../composables/use-route'; // Components -import Icon from '../icon'; -import Badge from '../badge'; +import { Icon } from '../icon'; +import { Badge } from '../badge'; const [name, bem] = createNamespace('action-bar-icon'); diff --git a/src/action-bar-icon/test/index.spec.ts b/src/action-bar-icon/test/index.spec.ts index b7695bba5..75c1c7fb5 100644 --- a/src/action-bar-icon/test/index.spec.ts +++ b/src/action-bar-icon/test/index.spec.ts @@ -1,5 +1,5 @@ import { mount } from '../../../test'; -import ActionBarIcon from '..'; +import { ActionBarIcon } from '..'; test('should render default slot correctly', () => { const wrapper = mount(ActionBarIcon, { diff --git a/src/action-bar/demo/index.vue b/src/action-bar/demo/index.vue index e4f6c0c06..fd7809732 100644 --- a/src/action-bar/demo/index.vue +++ b/src/action-bar/demo/index.vue @@ -64,7 +64,7 @@