<template>
  <div class="filter-container">
    <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleCancel">返回</el-button>
    <div>
      <iframe :src="docPath" scrolling="auto" frameborder="0" id="iframe"></iframe>
    </div>
  </div>
</template>

<script>
import waves from '@/directive/waves.js'// 水波纹指令

export default {
  directives: {
    waves
  },
  data() {
    return {
      docPath: undefined
    }
  },
  created() {
    // 初始化
    this.docPath = this.$route.query.docPath
  },
  mounted() {
    /**
     * iframe-宽高自适应显示
     */
    const oIframe = document.getElementById('iframe')
    const deviceWidth = document.documentElement.clientWidth
    const deviceHeight = document.documentElement.clientHeight
    oIframe.style.width = (Number(deviceWidth) - 220) + 'px'
    oIframe.style.height = (Number(deviceHeight) - 120) + 'px'
  },
  methods: {
    /**
     * 取消
     */
    handleCancel() {
      this.$router.go(-1)
    }
  }
}
</script>

