我正在从另一个组件调用模式,问题是我只能将其打开得很小,而不能打开得太大

comp1.html

<button type="button" class="btn btn-outline-primary btn-lg" (click)="openModal()">Upload

comp1.ts
import {modalComponent} from '../pages/modals/new-modal';

private modalService: BsModalService

constructor(private modalService: BsModalService)

openModal() {
    this.bsModalRef = this.modalService.show(modalComponent);
 }

modal.component.ts
constructor(private modalService: BsModalService, public bsModalRef: BsModalRef)

modal.html
<div bsModal #newModal="bs-modal"  tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
      </div>
    </div>
 </div>

最佳答案

尝试这样:

openModal() {
    this.bsModalRef = this.modalService.show(modalComponent, {class: 'modal-lg'});
}

08-19 06:33