欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

vue生成二維碼QR?Code的簡單實(shí)現(xiàn)方法示例

 更新時(shí)間:2022年04月28日 15:42:40   作者:~疆  
這篇文章主要為大家介紹了vue生成二維碼QR?Code的實(shí)現(xiàn)示例詳情,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

qrcodejs2

下載qrcodejs2

cnpm i -S qrcodejs2

使用

<template>
  <span ref="qrCodeUrl"></span>
</template>
<script>
import QRCode from "qrcodejs2";
export default {
  data() {
    return {};
  },
  mounted() {
    this.creatQrCode();
  },
  methods: {
    creatQrCode() {
      let a = new QRCode(this.$refs.qrCodeUrl, {
        text: "hello 大家好", // 需要轉(zhuǎn)換為二維碼的內(nèi)容
        width: 100,
        height: 100,
        colorDark: "black", //#000000為黑色
        colorLight: "white",
      });
      console.log("二維碼:", a);
    },
  },
};
</script>

vue-qr

可在二維碼中心添加圖片

下載:

cnpm i -S vue-qr

使用: 

實(shí)現(xiàn)效果 

 代碼示例

<template>
  <vue-qr
    :logoSrc="imageUrl"
    text="https://blog.csdn.net/qq_40323256/"
    :size="150"
    :margin="0"
    colorDark="black"
    colorLight="white"
  ></vue-qr>
</template>
<script>
import vueQr from "vue-qr";
export default {
  components: {
    vueQr,
  },
  data() {
    return {
      imageUrl: require("@/assets/logo.png"), //欲嵌入至二維碼中心的 LOGO 地址
    };
  },
};
</script>

以上就是vue生成二維碼QR Code的實(shí)現(xiàn)示例詳情的詳細(xì)內(nèi)容,更多關(guān)于vue生成二維碼QR Code的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評論