简体   繁体   English

ng-bootstrap 模态边界半径

[英]ng-bootstrap Modal border-radius

What is the best way to customize the border-radius of the NgBoostrap modal?自定义 NgBoostrap 模态的边界半径的最佳方法是什么?

 <ng-template #content let-c="close" let-d="dismiss"> <div class="modal-header"> <h4 class="modal-title" id="modal-basic-title">Test</h4> <button type="button" class="close" aria-label="Close" (click)="d('Cross click')"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <p>Hello, World!</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-outline-dark" (click)="c('Save click')">Save</button> </div> </ng-template>

You just need to add border-radius to modal-content class:您只需要将border-radius添加到modal-content class:

.modal-content{
    border-radius: 50px;
}

I went to my component's typescript and put this:我去了我的组件的 typescript 并把这个:

this.modalService.open(content, {centered: true, windowClass: 'modal-rounded', size: 'lg'});

Soon after I went to my main scss (styles.scss) and put this code there:不久后我去了我的主要 scss (styles.scss) 并将这段代码放在那里:

.modal-rounded {
    .modal-content {
      border-radius: 20px !important;
    }
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM