Vue error using download.js

the problem now is that I want to download the QR code picture with download.js, but I don"t know where the problem is. The QR code url is a picture in base64 format

.

<span class="zi">{{data.examName}}</span><span class="img"><img src="../../../assets/images/wechat.png" alt="" @click="load()"></span>

import download from "./download.js"
 methods: {
        load() {
            download(this.imgurl, "dlDataUrlBin.gif", "image/gif");
        },

clipboard.png

Jan.27,2022

because the download, introduced by import here corresponds to the fact that this function is not exported in the export,downloadjs in your js, it is referenced as not a function. If you are here, you can directly use the script tag in index.html to introduce download.js, and then you can use it here.

because the import used here is es6 modularization, the corresponding class library you reference should also be modular in order to introduce
for example:

// download.js

function download (){
    // ...
}
export default download 

in another page

import download form './download'
Menu