diff --git a/src/dialog/dialog.module.ts b/src/dialog/dialog.module.ts index 582e5a51c..9fcb4152a 100644 --- a/src/dialog/dialog.module.ts +++ b/src/dialog/dialog.module.ts @@ -38,3 +38,11 @@ import { DialogService } from './dialog.service'; providers: [DialogService], }) export class DialogModule {} + +export const DIALOG_MODULE = [ + DialogComponent, + DialogHeaderComponent, + DialogContentComponent, + DialogFooterComponent, + DialogCloseDirective, +] as const; diff --git a/src/drawer/component/drawer.component.ts b/src/drawer/component/drawer.component.ts index 36d45d9fd..e5cca781b 100644 --- a/src/drawer/component/drawer.component.ts +++ b/src/drawer/component/drawer.component.ts @@ -110,7 +110,7 @@ export class DrawerComponent< }); } else if (!visible.firstChange) { // 不希望默认关闭时,drawer 渲染后就触发 close 事件 - this.drawerRef.close(); + this.drawerRef?.close(); } } this.drawerService.updateOptions(this); diff --git a/src/drawer/drawer.module.ts b/src/drawer/drawer.module.ts index 4b1e8801c..cd0f75881 100644 --- a/src/drawer/drawer.module.ts +++ b/src/drawer/drawer.module.ts @@ -26,3 +26,10 @@ const COMMON = [ providers: [DrawerService], }) export class DrawerModule {} + +export const DRAWER_MODULE = [ + DrawerComponent, + DrawerHeaderDirective, + DrawerContentDirective, + DrawerFooterDirective, +] as const; diff --git a/src/dropdown/dropdown.module.ts b/src/dropdown/dropdown.module.ts index d5ab3cf1b..eb7e5a6c4 100644 --- a/src/dropdown/dropdown.module.ts +++ b/src/dropdown/dropdown.module.ts @@ -41,3 +41,14 @@ import { SubmenuComponent } from './submenu/submenu.component'; ], }) export class DropdownModule {} + +export const DROPDOWN_MODULE = [ + DropdownDirective, + DropdownActiveDirective, + DropdownButtonComponent, + MenuComponent, + MenuGroupComponent, + MenuGroupTitleDirective, + MenuItemComponent, + SubmenuComponent, +] as const; diff --git a/src/radio/radio.module.ts b/src/radio/radio.module.ts index abe60a851..fbbfc0ba5 100644 --- a/src/radio/radio.module.ts +++ b/src/radio/radio.module.ts @@ -18,3 +18,9 @@ import { RadioComponent } from './radio.component'; exports: [RadioComponent, RadioGroupComponent, RadioButtonComponent], }) export class RadioModule {} + +export const RADIO_MODULE = [ + RadioComponent, + RadioGroupComponent, + RadioButtonComponent, +] as const; diff --git a/src/time-picker/time-picker.module.ts b/src/time-picker/time-picker.module.ts index 59a1b25fc..6b6aa1c86 100644 --- a/src/time-picker/time-picker.module.ts +++ b/src/time-picker/time-picker.module.ts @@ -31,3 +31,8 @@ import { TimePickerPanelComponent } from './panel/panel.component'; exports: [TimePickerComponent, TimePickerPanelComponent], }) export class TimePickerModule {} + +export const TIME_PICKER_MODULE = [ + TimePickerComponent, + TimePickerPanelComponent, +] as const; diff --git a/src/tooltip/tooltip.module.ts b/src/tooltip/tooltip.module.ts index a280cd42b..a16be9c9b 100644 --- a/src/tooltip/tooltip.module.ts +++ b/src/tooltip/tooltip.module.ts @@ -19,3 +19,9 @@ import { TooltipDirective } from './tooltip.directive'; exports: [TooltipDirective, TooltipActiveDirective, TooltipCopyDirective], }) export class TooltipModule {} + +export const TOOLTIP_MODULE = [ + TooltipDirective, + TooltipActiveDirective, + TooltipCopyDirective, +] as const;