54. (Understanding) Generate QR code plugin
Installation command: cnpm install --save qrcode
For details, please check the official website: https://www.npmjs.com/package/qrcode
Instructions:
import QRCode from "qrcode";
result.data.codeUrl = "I am a pony!";
//生成二维(地址),这个url实际就是一个二维码,要想展示的话请放在<img>标签src中属性进行展示
let url = await QRCode.toDataURL(this.payInfo.codeUrl);
Links to my other related articles
1. Vue Shangpinhui mall project-day07【44. Personal center secondary routing construction+45. My order+46. Optimize login jump+47. Exclusive guard】
2. Vue Shangpinhui mall project-day07【 vue plugin-48. (understand) image lazy loading plugin]
3. vue Shangpinhui mall project-day07 [vue plugin-49. (understand) custom plugin]
4. vue Shangpinhui mall project-day07 [vue plugin- 50. (Understanding) Form Validation Plugin]
5. Vue Shangpinhui Mall Project-day07【51. Routing lazy loading】
6. Vue Shangpinhui Mall Project-day07【52. Pack files, process map files】
7. vue Shangpinhui mall project-day07【53.nginx reverse proxy configuration】
8. vue Shangpinhui mall project-day07【vue plug-in-54. (understand) generate QR code plug-in】
9. Vue Shangpinhui mall project- day07 [55. Coding test and package release project]