我使用 angular7 , bootstrap4 并使用 PSPDFKit 在查看器中打开 pdf 文件
查看器在模态中打开。
模态没有响应的问题。
我还希望 pspdfkit 以所有大小的模态打开(模态大小的 100%)
这是html代码:
<style>
#app {
width: 100%;
height: 100%;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
</style>
<div class="modal-dialog modal-800" >
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title pull-left">attachmnt</h4>
<button type="button" class="close pull-right" aria-label="Close" (click)="bsModalRef.hide()">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="app">
</div>
</div>
<div class="modal-footer">
<button *ngIf="this.categAttachmnt !=null" type="button" class="btn btn-default" (click)="saveFile()">حفظ التعديلات</button>
<button type="button" class="btn btn-default" (click)="bsModalRef.hide()">close</button>
<button type="button" class="btn btn-default" (click)="getURLDowload()">download </button>
</div>
</div>
</div>
.css 代码
.modal{
z-index:1000 !important;
}
.modal-backdrop{
z-index:999 !important;
}
[dir='rtl'] .modal-title{
color: rgb(255, 82, 82);
//font-family: 'Roboto', sans-serif !important;
margin-right: 20px !important;
font-weight: bold;
}
.bsm-modal .bsm-modal-x-btn {
top: 8px;
margin: 0;
z-index: 1;
padding: 0;
opacity: 1;
right: 15px;
cursor: pointer;
line-height: 1;
text-shadow: none;
position: absolute;
font-weight: 700;
font-family: inherit;
background: transparent;
border: 0;
}
.modal-lg {
max-width: 90%;
height: 100%;
}
.modal-dialog .gray .modal-lg > .modal-content{
height:100%
}
.modal-dialog > .modal-content {
height: 720px;
width: 100%;
}
.modal-dialog.modal-800 {
width: 800px;
margin: 30px auto;
}
.modal-footer button {
width: 10%;
margin: 1%;
padding: 0.5% 1%;
}
打开模态的代码:
openModalWithComponent() {
const initialState = {
list: [
'Open a modal with component',
'Pass your data',
'Do something else',
'...'
],
title: 'Document Viewer'
};
this.bsModalRef = this.modalService.show(ModalComponent, Object.assign({ initialState }, { class: 'gray modal-lg' }));
this.bsModalRef.content.closeBtnName = 'Close';
}