<template>
    <iframe  height="100%" width="100%" scrolling="auto" :src="href" frameborder="0" class="body-content"></iframe>
</template>
<script>
    export default {
        name:"WebView",
        data(){
          return {
              href:""
          };
        },
        props: {
            src: {
                type: String
            },params:{
                type: Object
            }
        },
        created(){
          this.href=this.src;
          if(this.params&&this.params.src)
              this.href=this.params.src;
          console.log("打开外部链接", this);
          this.getRouter();
        },
        methods:{
            getRouter(){
                if(this.$route&&this.$route.query&&this.$route.query.src) {
                    this.href=this.$route.query.src;
                }
                if(this.$route&&this.$route.params&&this.$route.params.src) {
                    this.href=this.$route.params.src;
                }
            }
        }
    }
</script>
