From b1bb913f9d7c5131c09e6bcce36962de471416de Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 24 Jun 2021 22:47:36 +0800 Subject: [PATCH] fix: `Layout` `RangePicker` `WeekPicker` `Textarea` on-demand loading failure --- components/components.ts | 10 ++++++++-- components/date-picker/index.ts | 4 ++-- components/input/index.ts | 7 ++++++- components/layout/index.ts | 9 ++++----- components/menu/src/MenuItem.tsx | 2 +- tests/__snapshots__/index.test.js.snap | 8 ++++---- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/components/components.ts b/components/components.ts index 058aca5c6..f02cb7ad8 100644 --- a/components/components.ts +++ b/components/components.ts @@ -71,7 +71,7 @@ export { default as Form, FormItem } from './form'; export { default as Grid } from './grid'; -export { default as Input, InputGroup, InputPassword, InputSearch, TextArea } from './input'; +export { default as Input, InputGroup, InputPassword, InputSearch, Textarea } from './input'; export type { ImageProps } from './image'; export { default as Image, ImagePreviewGroup } from './image'; @@ -80,7 +80,13 @@ export type { InputNumberProps } from './input-number'; export { default as InputNumber } from './input-number'; export type { LayoutProps } from './layout'; -export { default as Layout, LayoutHeader, LayouSider, LayouFooter, LayouContent } from './layout'; +export { + default as Layout, + LayoutHeader, + LayoutSider, + LayoutFooter, + LayoutContent, +} from './layout'; export type { ListProps } from './list'; export { default as List, ListItem, ListItemMeta } from './list'; diff --git a/components/date-picker/index.ts b/components/date-picker/index.ts index 1f105e876..872903199 100755 --- a/components/date-picker/index.ts +++ b/components/date-picker/index.ts @@ -35,7 +35,7 @@ const DatePicker = wrapPicker( readonly WeekPicker: typeof WrappedWeekPicker; }; -const MonthPicker = wrapPicker( +export const MonthPicker = wrapPicker( createPicker(MonthCalendar as any, MonthPickerProps, 'AMonthPicker'), MonthPickerProps, 'month', @@ -56,6 +56,6 @@ DatePicker.install = function (app: App) { return app; }; -export { RangePicker, MonthPicker, WeekPicker }; +export { WrappedRangePicker as RangePicker, WrappedWeekPicker as WeekPicker }; export default DatePicker as typeof DatePicker & Plugin; diff --git a/components/input/index.ts b/components/input/index.ts index 8c2444140..843372da0 100644 --- a/components/input/index.ts +++ b/components/input/index.ts @@ -20,7 +20,12 @@ Input.install = function (app: App) { return app; }; -export { Group as InputGroup, Search as InputSearch, TextArea, Password as InputPassword }; +export { + Group as InputGroup, + Search as InputSearch, + TextArea as Textarea, + Password as InputPassword, +}; export default Input as typeof Input & Plugin & { diff --git a/components/layout/index.ts b/components/layout/index.ts index 383445c53..242d47fbe 100644 --- a/components/layout/index.ts +++ b/components/layout/index.ts @@ -16,12 +16,11 @@ Layout.install = function (app: App) { app.component(Layout.Content.name, Layout.Content); return app; }; -const LayoutHeader = Layout.Header; -const LayouFooter = Layout.Footer; -const LayouSider = Layout.Sider; -const LayouContent = Layout.Content; +export const LayoutHeader = Layout.Header; +export const LayoutFooter = Layout.Footer; +export const LayoutSider = Layout.Sider; +export const LayoutContent = Layout.Content; -export { LayoutHeader, LayouSider, LayouFooter, LayouContent }; export default Layout as typeof Layout & Plugin & { readonly Sider: typeof Sider; diff --git a/components/menu/src/MenuItem.tsx b/components/menu/src/MenuItem.tsx index 4608128ad..a2fba2184 100644 --- a/components/menu/src/MenuItem.tsx +++ b/components/menu/src/MenuItem.tsx @@ -172,7 +172,7 @@ export default defineComponent({ const childrenLength = children.length; let tooltipTitle: any = title; if (typeof title === 'undefined') { - tooltipTitle = firstLevel ? children : ''; + tooltipTitle = firstLevel && childrenLength ? children : ''; } else if (title === false) { tooltipTitle = ''; } diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap index c4ef7f5d7..15eaac19f 100644 --- a/tests/__snapshots__/index.test.js.snap +++ b/tests/__snapshots__/index.test.js.snap @@ -53,15 +53,15 @@ Array [ "InputGroup", "InputPassword", "InputSearch", - "TextArea", + "Textarea", "Image", "ImagePreviewGroup", "InputNumber", "Layout", "LayoutHeader", - "LayouSider", - "LayouFooter", - "LayouContent", + "LayoutSider", + "LayoutFooter", + "LayoutContent", "List", "ListItem", "ListItemMeta",