<template>
  <div>
    <img :src="imrUrl">
  </div>

</template>

<script >
import QRCode from 'qrcode'
export default {
  name: "qrCodes",
  props:{
    url:{
      type:String,
      default:''
    }
  },
  data(){
    return{
      imrUrl:''
    }
  },
  mounted(){
    QRCode.toDataURL(this.url)
        .then(url => {
          console.log(url)
          this.imrUrl=url;
        })
        .catch(err => {
          console.error(err)
        })
  }
}
</script>
<style scoped>
#qrcode {
  width:160px;
  height:160px;
  margin-top:15px;
}
</style>