如何解决禁用星云窗口最大化
如何打开 nBWindow 并做两件事,
- 阻止最大化选项
- 更改背景颜色
这是 API and docs,在配置期间,我没有办法禁用最大化功能
默认代码,很好,但我需要禁用图标/功能
import { Component,TemplateRef,ViewChild } from '@angular/core';
import { NbWindowService } from '@nebular/theme';
@Component({
template: `
<button (click)="openWindowWithBackdrop()" nbButton>Open window with backdrop</button>
<button (click)="openWindowWithoutBackdrop()" nbButton>Open window without backdrop</button>
<ng-template #disabledEsc>
Disabled close on escape click.
</ng-template>
<ng-template #escClose>
Click escape to close.
</ng-template>
`,styleUrls: [ './window.scss' ],})
export class WindowsBackdropComponent {
@ViewChild('escClose',{ read: TemplateRef }) escCloseTemplate: TemplateRef<HTMLElement>;
@ViewChild('disabledEsc',{ read: TemplateRef }) disabledEscTemplate: TemplateRef<HTMLElement>;
constructor(private windowService: NbWindowService) {}
openWindowWithBackdrop() {
this.windowService.open(
this.escCloseTemplate,{ title: 'Window with backdrop',hasBackdrop: true },);
}
openWindowWithoutBackdrop() {
this.windowService.open(
this.disabledEscTemplate,{ title: 'Window without backdrop',hasBackdrop: false,closeOnEsc: false },);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。