preface

The product manager made a request to combine a QR code with different posters for customers to download and scan. At this time we backend little sister lazy, think backend do too much trouble, find me py wave privately, this time I can not help but beauty temptation, can only compromise front-end to deal with… Ah, do a front end so tired!! Don’t say much, directly on the effect

Implementation effect

Effect after successful download

The principle of

In fact, the principle is very simple, mainly using canvas, two pictures into one and download to the local

Method of use

1 Install yarn add html2Canvas or NPM install html2Canvas

Import html2canvas from ‘html2canvas’

3 Code Examples

conclusion

Summary what summary of ah, after the function realizes that must go to the back end little elder sister there to show off skills a wave ah, see elder brother this solves a trouble for you again, still don’t give elder brother pass tea, ha ha ha ha ha ha!!