<template>
    <div style="width: 100%;height: 100%;" :style="{textAlign:params.textAlign}">
    <a :href="href" title="点击查看大图" target="_blank">
        <img :src="href" :style="{width:params.width,height:params.height}"/>
    </a>
    </div>
</template>
<script>
    export default {
        name:"ImageView",
        data(){
          return {
              href:""
          };
        },
        props: {
            src: {
                type: String
            },params:{
                type: Object
            }
        },
        created(){
          this.href=this.src;
          console.log(this.src,this.params);
          if(this.params&&this.params.src)
              this.href=this.params.src;
          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>
