• vue.js显示base64string图片


    昨天在vue.js项目中,产生彩色二维码,并显示出来。

    如这个样子:

    敢用手机扫一扫? 哈哈,这个二维码只是本博客http://insus.cnblogs.com链接而已。

    代码简单:

    <div id="test">
            <img :src="'data:image/png;base64,'+ qrcode"/>       
        </div>
    HTML Source Code
    var vue_content = new Vue({
                el: '#test',
                data() {
                    return {
                        qrcode: null
                    }
                },
                mounted() {
                    axios
                        .get('/api/BC/GetColorQrCode')
                        .then(response => (
                            this.qrcode = response.data)
                        )
                        .catch(function (error) {
                            console.log(error);
                        });
                }
            })
    JavaScript Source Code
  • 相关阅读:
    sobel
    构造函数
    #pragma once & ifnde
    #pragma comment
    SET容器
    重载[] int& operator[ ]( )
    仿函数 operator()()
    remove_if erase
    vector
    map
  • 原文地址:https://www.cnblogs.com/insus/p/13418098.html
Copyright © 2020-2023  润新知