jsPDF: html2canvas not loaded while using new .html() method

前端 未结 4 2511
刺人心
刺人心 2021-02-20 03:10

I want to use jsPDF.html to convert html page to pdf, and I\'m using this code:

savePdf () {
  var pdf = new jsPDF({u         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-20 04:16

    For all of you who are using webpack what I did is I added html2canvas to a ProvidePlugin. You can read about this here

    // webpack configuration
    plugins: [
        new webpack.ProvidePlugin({
            html2canvas: 'html2canvas'
        });
    ]
    

提交回复
热议问题