DevCloudFE / ng-devui

Angular UI Component Library based on DevUI Design
https://devui.design
MIT License
1.75k stars 210 forks source link

🐛 [Bug]: tabs中签入iframe的问题 #342

Closed 75910456 closed 7 months ago

75910456 commented 11 months ago

Version

ng-devui@16.1.0

Angular Version

16.2.12

Link to minimal reproduction

<d-tabs
  class="d-tabs"
  [type]="'wrapped'"
  [(activeTab)]="tabActiveId"
  [closeable]="true"
  [closeableIds]="closeableIds"
  (activeTabChange)="activeTabChange($event)"
>
  <d-tab
    class="d-tab"
    *ngFor="let item of dynamicTabData"
    [id]="item.id"
    [title]="item.title"
  >
    <iframe class="iframe" src="https://xxxxxxxx/"></iframe>
  </d-tab>
</d-tabs>

Step to reproduce

d-tabs中放入iframe,每次tab切换后,iframe中的内容都被重新加载了,要如何使iframe不重新加载呢?

<d-tabs
  class="d-tabs"
  [type]="'wrapped'"
  [(activeTab)]="tabActiveId"
  [closeable]="true"
  [closeableIds]="closeableIds"
  (activeTabChange)="activeTabChange($event)"
>
  <d-tab
    class="d-tab"
    *ngFor="let item of dynamicTabData"
    [id]="item.id"
    [title]="item.title"
  >
    <iframe class="iframe" src="https://xxxxxxxx/"></iframe>
  </d-tab>
</d-tabs>

What is expected

No response

What is actually happening

No response

Any additional comments (optional)

No response

Simplelegant commented 7 months ago

设置isHidden=true就不销毁content的dom了