diff --git a/components/alert/alert.component.ts b/components/alert/alert.component.ts index a3fc9c025d..593744aa7f 100644 --- a/components/alert/alert.component.ts +++ b/components/alert/alert.component.ts @@ -61,6 +61,9 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'alert'; {{ nzDescription }} +
+ {{ nzAction }} +
+
+ + +

Error Description Error Description Error Description Error Description

+
+ + + +
+ + + + +
+ + +

Info Description Info Description Info Description Info Description

+
+ + + + + + + ` +}) +export class NzDemoAlertActionComponent { + doAction(action: string): void { + console.log(`Do alert's action: ${action}`); + } +} diff --git a/components/alert/demo/module b/components/alert/demo/module index ccb06a22fe..10c2efa9fa 100644 --- a/components/alert/demo/module +++ b/components/alert/demo/module @@ -1,3 +1,5 @@ import { NzAlertModule } from 'ng-zorro-antd/alert'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzSpaceModule } from 'ng-zorro-antd/space'; -export const moduleList = [ NzAlertModule ]; +export const moduleList = [ NzAlertModule, NzButtonModule, NzSpaceModule ]; diff --git a/components/alert/doc/index.en-US.md b/components/alert/doc/index.en-US.md index dc5a937b16..f1b8da9111 100644 --- a/components/alert/doc/index.en-US.md +++ b/components/alert/doc/index.en-US.md @@ -23,6 +23,7 @@ import { NzAlertModule } from 'ng-zorro-antd/alert'; | Property | Description | Type | Default | Global Config | | -------- | ----------- | ---- | ------- | ------------- | | `[nzBanner]` | Whether to show as banner | `boolean` | `false` | +| `[nzAction]` | Customized alert's action | `string \| TemplateRef` | - | | `[nzCloseable]` | Whether Alert can be closed | `boolean` | - | ✅ | | `[nzCloseText]` | Close text to show | `string \| TemplateRef` | - | | `[nzDescription]` | Additional content of Alert | `string \| TemplateRef` | - | diff --git a/components/alert/doc/index.zh-CN.md b/components/alert/doc/index.zh-CN.md index b817b28f69..10d36504ba 100644 --- a/components/alert/doc/index.zh-CN.md +++ b/components/alert/doc/index.zh-CN.md @@ -24,6 +24,7 @@ import { NzAlertModule } from 'ng-zorro-antd/alert'; | 参数 | 说明 | 类型 | 默认值 | 全局配置 | | --- | --- | --- | --- | --- | | `[nzBanner]` | 是否用作顶部公告 | `boolean` | `false` | +| `[nzAction]` | 自定义操作项 | `string \| TemplateRef` | - | | `[nzCloseable]` | 默认不显示关闭按钮 | `boolean` | - | ✅ | | `[nzCloseText]` | 自定义关闭按钮 | `string \| TemplateRef` | - | | `[nzDescription]` | 警告提示的辅助性文字介绍 | `string \| TemplateRef` | - |