The requirejs page is executed only once?

$("-sharpprint-esheet").click(function(){
    require(["jsname"], function(){
        ******
    })
})
If the

page is not refreshed, the click operation of print-esheet can only execute the code in require once, and the code in require cannot be executed on the second click. How to deal with this situation?

Mar.31,2021

should be cached by require, and repeated loading of the same module will be ignored.

you can judge the number of calls, execute it as a callback function for the first time, and then directly execute the specified function

.
Menu