用法:
1.下包: npm install --save qrcode
2.导包: import QRCode from 'qrcode'
3.用包:
<template>
<div>
<img :src="src" alt="" />
</div>
</template>
<script>
import QRCode from 'qrcode'
export default {
data () {
return {
src: ''
}
},
mounted () {
// QRCode.toDataURL(
// 'https://vant-contrib.gitee.io/vant/#/zh-CN/popup',
// (err, url) => {
// console.log(url)
// this.src = url
// }
// )
QRCode.toDataURL('https://vant-contrib.gitee.io/vant/#/zh-CN/popup').then(
url => {
this.src = url
}
)
}
}
</script>
<style></style>
链接:
npm-qrcode:https://www.npmjs.com/package/qrcode
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。