标签:rip erro log sof methods mount fun mic size
代码如下:
引入qrcode--------npm install qrcode <template> <div> <div id=‘code‘></div> <canvas id="canvas"></canvas> </div> </template> <script> import Vue from ‘vue‘ import QRCode from ‘qrcode‘ Vue.use(QRCode) export default { data() { return { codes: ‘‘ } }, methods: { useqrcode() { var canvas = document.getElementById(‘canvas‘) QRCode.toCanvas(canvas, ‘http://www.baidu.com‘, function(error) { if (error) console.error(error) console.log(‘success!‘); }) } }, mounted() { this.useqrcode(); } } </script> <style> #canvas { width: 200px !important; height: 200px !important; } </style>
标签:rip erro log sof methods mount fun mic size
原文地址:https://www.cnblogs.com/hool/p/12045574.html