The following is the code:
this.$http.jsonp('https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su', {
wd: 'a'
},{
jsonp: 'cb'
}).then(function(res) {
alert(res.data.s);
}, function(res) {
alert(res.status);
});
The following is the error message:
window.baidu.sug Does your window have this object? He probably didn’t change his name to callback, or else it’s not called callback
The string to be spelled later should be written in params (based on version 1.3, the subsequent updates are not clear and have been useless for a long time)
You can take a look at the documentation on github
vue-resource
Since I don’t know how to modify "window.baidu.sug".
Follow what this source code document says
https://github.com/pagekit/vu...
Just like this