Current location - Quotes Website - Signature design - Does the a tag dynamically generated by vue download file have to carry the file name?
Does the a tag dynamically generated by vue download file have to carry the file name?

The a tag dynamically generated by vue download file must have the file name, otherwise the value of the internal variable of the function will be changed.

The main reason is: due to closure (function nested function, when an internal function is referenced outside the scope where it is defined, a closure of the internal function is created) will cause the The variables are all stored in memory, which consumes a lot of memory. The closure will change the value of the variables inside the parent function outside the parent function. If you use the parent function as an object, the closure as its public method, and the internal variables as its private properties, if you do not include a file name, the values ??of the internal variables of the parent function will be changed at will.