diff --git a/src/drawer/component/drawer.component.ts b/src/drawer/component/drawer.component.ts index 2ddd411d2..83a0d03ba 100644 --- a/src/drawer/component/drawer.component.ts +++ b/src/drawer/component/drawer.component.ts @@ -30,8 +30,7 @@ import { DrawerOptions, DrawerSize } from '../types'; providers: [DrawerService], }) export class DrawerComponent - extends DrawerOptions - implements AfterViewInit, OnChanges + implements AfterViewInit, OnChanges, Required> { @Input() title: string | TemplateRef; @@ -91,9 +90,7 @@ export class DrawerComponent private drawerRef: DrawerRef; - constructor(private readonly drawerService: DrawerService) { - super(); - } + constructor(private readonly drawerService: DrawerService) {} ngOnChanges(changes: SimpleChanges): void { const { visible } = changes; diff --git a/src/drawer/component/internal/internal.component.html b/src/drawer/component/internal/internal.component.html index 09aad87a8..1d066ffcb 100644 --- a/src/drawer/component/internal/internal.component.html +++ b/src/drawer/component/internal/internal.component.html @@ -20,7 +20,7 @@ @@ -42,10 +42,7 @@ @@ -58,7 +55,7 @@ diff --git a/src/drawer/types.ts b/src/drawer/types.ts index b79d537c7..32caf79af 100644 --- a/src/drawer/types.ts +++ b/src/drawer/types.ts @@ -7,19 +7,19 @@ export enum DrawerSize { Big = 'big', } -export abstract class DrawerOptions { - abstract title?: string | TemplateRef; - abstract content?: ComponentType | TemplateRef; - abstract footer?: string | TemplateRef; - abstract contentParams?: C; // 不仅作为content的参数,同时是title和footer的上下文 - abstract width?: number; - abstract size?: DrawerSize; // 内置的宽度尺寸,也可以使用 width 自定义 - abstract offsetY?: string; - abstract divider?: boolean; - abstract drawerClass?: string; - abstract visible?: boolean; - abstract showClose?: boolean; - abstract mask?: boolean; - abstract maskClosable?: boolean; // 点击背景是否关闭抽屉 - abstract hideOnClickOutside?: boolean; // 在抽屉外点击是否关闭抽屉,与 maskClosable 的区别是是否有 mask +export interface DrawerOptions { + title?: string | TemplateRef; + content?: ComponentType | TemplateRef; + footer?: string | TemplateRef; + contentParams?: C; // 不仅作为content的参数,同时是title和footer的上下文 + width?: number; + size?: DrawerSize; // 内置的宽度尺寸,也可以使用 width 自定义 + offsetY?: string; + divider?: boolean; + drawerClass?: string; + visible?: boolean; + showClose?: boolean; + mask?: boolean; + maskClosable?: boolean; // 点击背景是否关闭抽屉 + hideOnClickOutside?: boolean; // 在抽屉外点击是否关闭抽屉,与 maskClosable 的区别是是否有 mask }