It’s like this, I use the native jsonp in vue, and then the jsonp returned in the background cannot always be called when calling callback! The following is part of my source code.
https://codepen.io/1206189299...
Error report:
Please ignore the packaging error
window.getData=function (data){
xxx logic
}
Obviously Vue has its own namespace, if you don’t use it explicitly
Defining the global function in this way, jsonp obviously cannot successfully call the callback function.
To handle cross-domain requests, you can use webpack to configure the proxy to forward the request or use the node proxy service to forward the request