我正在使用vue js开发应用程序.根据我的设置,我需要在设置更改时将变量传递给我的url.
$.get('http://172.16.1.157:8002/firstcolumn/' + c1v + '/' + c1b, function (data) {
// some code...
});
Run Code Online (Sandbox Code Playgroud)
但是当我的应用程序点击url时,它会显示以下消息.
无法加载http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-10-26:从' http://172.16.1.157:8002/firstcolumn/2017-03-01/2017-重定向已被CORS政策阻止10-26 '到' http://172.16.1.157:8002 / firstcolumn://-03-1207-10-26/':没有'Access-Control-Allow-Origin'标题是出现在请求的资源上.因此,不允许来源" http:// localhost:8080 "访问.
我有一个使用vue js的单页面应用程序.现在我必须从3个不同的源URL获取数据,然后需要在对象中映射以在应用程序上使用它.
或者在将其映射到后端后从一个URL获取它是否更好?
$.get(furl, function(data) {
this.items1 = data;
});
$.get(furl, function(data) {
this.items2 = data;
});
$.get(furl, function(data) {
this.items3 = data;
});
// if I want to merge it here. I am not getting items1, items2, items3 here.
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
我正在通过api链接使用vue js框架使用axios解析json数据。有一个字段值:20分钟后为10,可以更新。则值将为11。如何在好友中更新此值。有什么建议吗?
getFollowers() {
return new Promise((resolve, reject) => {
axios.get('https://api.github.com/users/octocat')
.then(response => resolve(response))
.catch(err => reject(error))
});
}
Run Code Online (Sandbox Code Playgroud)
我正在追踪这个网址:https : //jsfiddle.net/jonataswalker/416oz6ga/
我希望这样,如果关注者的价值发生变化,那么我的前端价值就会自动发生变化。