<template>
  <div class="previewPage">
    <div class="title-box">
      <p>{{previewData.name}}</p>
      <p class="reset-button-one" @click="backPage">返回</p>
    </div>
    <div class="info-box" v-if="iframeSrc">
      <iframe
        class="iframe"
        :src="iframeSrc" scrolling="auto" frameborder="0">
      </iframe>
    </div>
  </div>
</template>

<script>
  export default {
    name: "previewPage",
    props:{
      previewData:{},
    },
    data(){
      return{
        iframeSrc:"",
      }
    },
    mounted(){
      this.iframeSrcFunction();
    },
    methods: {
      iframeSrcFunction(){
        this.iframeSrc = this.urlJudge(this.previewData.url);
      },
      // 返回按钮
      backPage(){
        this.$parent.pageTypeClickMin(1);
      },
    }
  }
</script>

<style lang="scss" scoped>
  .previewPage{
    flex:1;
    display: flex!important;
    flex-direction: column;
    border-radius:10px;
    *{
      margin:0;
    }
    .title-box{
      display: flex;
      border-bottom:1px solid #dedede;
      p:nth-child(1){
        flex:1;
        font-size:18px;
        line-height:80px;
        color:#0045AF;
        padding-left:20px;
      }
      p:nth-child(2){
        margin:20px;
      }
    }
    .info-box{
      margin:20px;
      overflow-y: scroll;
      flex:1;
      display: flex;
      flex-direction: column;
      iframe{
        flex:1;
      }
    }
  }
</style>
