<template>
  <div>
    <iframe v-if="src && src!== null" ref="menuContent" :src="src" name="menu-content" title="Main content" frameborder="0" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      src: null
    }
  },
  watch: {
    $route(to, from) {
      // 必须这样写，否则会在切换页面时无法获得pageCode参数
      this.src = this.$route.query.src
    }
  },
  mounted() {
    this.src = this.$route.query.src
  }
}
</script>

<style lang="scss" scoped>
iframe{
  width: 100%;
  height: calc(100vh - 50px);
}
</style>
