【发布时间】:2020-07-31 18:07:16
【问题描述】:
我正在努力解决这个问题。如果对话框上没有弹出菜单,然后关闭对话框,当你重新打开它时,菜单不会出现
<p-dialog modal="true" appendTo="body" [contentStyle]="{width: '800px', height: '650px' }" [(visible)]="projectManager">
<div style="margin-bottom: 20px;
text-align: center;">
<img src="./assets/images/qubix32.png" style="display: inline">
<span style="font-size: 20px"> Welcome </span>
</div>
<div class="p-grid" >
<div class="p-col-fixed" style="width:150px">
<span>work</span>
<p-menu [model]="main"></p-menu>
</div>
<div class="p-col">
<h3 style="margin-bottom: 10px"> Recent projects </h3>
<div style="margin-bottom: 4px" *ngFor="let program of this.programs">
<a href="#" [ngStyle]="{'font-size':'12px'}"[title]="program.value" ><br/><u>{{program.label}}</u></a>
<span [ngStyle]="{'font-size':'10px', 'font-color': 'gray'}"> <br/> {{program.value}}</span>
</div>
</div>
<div class="p-col" class="p-col-fixed" style="width:140px">
<span>work</span>
<p-menu [ngStyle]="{'float': 'right'}" [model]="info"></p-menu>
</div>
</div>
<div>
<h3 style="margin-top: 20px"> Your Repo </h3>
<p-tree [contextMenu]="cm" [value]="files1" selectionMode="multiple" [draggableNodes]="true" [droppableNodes]="true" draggableScope="self" droppableScope="self" [filter]="true" [style]="{'margin-top':'10px', 'width': '100%', 'height': '200px','max-height':'268px','overflow':'auto'}"></p-tree>
</div>
<p-contextMenu #cm appendTo="body" [model]="contextMenu"></p-contextMenu>
</p-dialog>
不存在来自代码的其他操作。 分析生成的样式,我意识到某些东西将菜单的不透明度设置为 0。如何克服?
【问题讨论】: