PanJiaChen / vue-element-admin

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin
MIT License
88.03k stars 30.48k forks source link

Slow performance open/hide sidebar with iframe #3095

Open sabatale opened 4 years ago

sabatale commented 4 years ago

Bug report(问题描述)

Steps to reproduce(问题复现步骤)

Screenshot or Gif(截图或动态图)

slow_iframe

Reproduction

In my real use case, I have an iframe with a lot more content from Metabase (https://www.metabase.com/docs/latest/administration-guide/13-embedding.html) but you can see the performance decreasing even if you're iframing a youtube video (although less visible):

slow_iframe_vid

<template>
  <div class="dashboard-editor-container">
    <div>
      <iframe
          id="iframedash"
          :src="emptyGif"
          frameborder="0"
          allowtransparency
          style="width: 1px; min-width: 100%; min-height:900px;"
          scrolling="no"
      ></iframe>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import PanThumb from '@/components/PanThumb'
import GithubCorner from '@/components/GithubCorner'

export default {
  name: 'DashboardEditor',
  components: { PanThumb, GithubCorner },
  data() {
    return {
      emptyGif: 'https://www.youtube.com/embed/L_LUpnjgPso'
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'avatar',
      'roles'
    ]),
  }
}
</script>

<style lang="scss" scoped>
  .emptyGif {
    display: block;
    width: 45%;
    margin: 0 auto;
  }

  .dashboard-editor-container {
    background-color: white;
    min-height: 100vh;
    padding: 0px 60px 0px;
    .pan-info-roles {
      font-size: 12px;
      font-weight: 700;
      color: #333;
      display: block;
    }
    .info-container {
      position: relative;
      margin-left: 190px;
      height: 150px;
      line-height: 200px;
      .display_name {
        font-size: 48px;
        line-height: 48px;
        color: #212121;
        position: absolute;
        top: 25px;
      }
    }
  }
</style>

Other relevant information(格外信息)

iwusong commented 4 years ago

iframe fixed width