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
给我你的怀抱2017-07-05 10:44:18
Obviously Vue has its own namespace, if you don’t use it explicitly
window.yourCallbackFunction=function(data){
//处理 data
}
Defining the global function in this way, jsonp obviously cannot successfully call the callback function.
三叔2017-07-05 10:44:18
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