admin管理员组文章数量:1313162
I am using Notification ponent from ant design and I want to remove close (X) button from Notification box.
I've tried adding closable: false
and icon: null
but not working
notification.info({
description: "Sample description",
closable: false,
icon: null
})
I am using Notification ponent from ant design and I want to remove close (X) button from Notification box.
I've tried adding closable: false
and icon: null
but not working
notification.info({
description: "Sample description",
closable: false,
icon: null
})
Share
Improve this question
edited Jul 17, 2019 at 12:30
Dennis Vash
54k12 gold badges117 silver badges132 bronze badges
asked Jul 17, 2019 at 11:28
sakethsaketh
331 silver badge5 bronze badges
3 Answers
Reset to default 6if you are using Ant Design >= 3.x notification have a property call closeIcon which accepts ReactNode you can use closeIcon : (<div></div>)
to hide the close icon. check the doc here Notification Component
Happy Coding...
Ant Design Notification doesn't accept closable
prop. Please read the documentation.
I use Angular with ng-zorro. In the documentation there is this part. nzCloseIcon --> Custom close icon --> TemplateRef | string
I use a TemplateRef to do it.
html:
`<ng-template #none></ng-template>`
ts:
@ViewChild("none", { static: false }) none?: TemplateRef<{}>;
this.nzNotification.template(
this.template!, { nzCloseIcon: this.none }
);
本文标签: javascriptRemove default close ( X ) button from ant design NotificationStack Overflow
版权声明:本文标题:javascript - Remove default close ( X ) button from ant design Notification - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741931480a2405599.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论