Lightning Web Component: Create a QR Code Generator using ES6 code (Approach 2)
In the previous blog post, you learned how to generate your QR code using Google APIs. However, there are instances when businesses prefer not to rely on any external APIs and opt to keep everything in-house.
This approach is chosen to mitigate the risk of API deprecation. In this blog post, we will show you how to create a QR code within Salesforce Lightning Web Components using ES6 code.
Create a Lightning Web Component (LWC).
Within the same folder as your LWC, add a module named "qrcode.js."
Now, insert the following code into the "qrcode.js" file.
qrcode.js
qR_Code_Generator_LWC.html
qR_Code_Generator_LWC.js
qR_Code_Generator_LWC.js-meta.xml
Output
Congratulations! You've now successfully generated a QR code within your Lightning Web Component (LWC). Give it a try and share your feedback with me. I'd love to hear about your experience!
--
1yHi Gaurav Gupta - This option is not working for iOS devices . Qr code is not getting generated for IOS devices, browser and android devices works fine.