记录一次vue 项目中使用 iframe 嵌套其他项目

<template>
  <div class="iframe">
    <div
      style="height:100%"
      v-for="(item,index) in copyMeunListData"
      :key="index"
      v-show="item === url"
    >
      <iframe
        :id="`mask_id${item}`"
        :src="item"
        height="100%"
        width="100%"
        name="demo"
        frameborder="0"
        scrolling="auto"
        sandbox="allow-same-origin allow-top-navigation allow-forms allow-scripts"
      ></iframe>
    </div>
  </div>
</template>
<script>
export default {
  name: 'myIframe',
  props: {
    copyMeunListData: {
      type: Array
    },
    url: {
      type: String
    }
  }
}
</script>
<style lang='scss' scoped>
.iframe {
  height: calc(100% - 60px);
}
</style>

  

(0)

相关推荐