在 vue js 中使用 vue-resource 时带有参数的 GET 请求



您好,我正在尝试在单击任务名称时获取任务的详细信息,Get API 应将任务名称作为参数并返回任务详细信息,我无法在我的 API 中传递参数

这个解决方案可以帮助你 vue-resource :

fetchdata() {
this.$http.get('data.json') //this data.json in URL provided to fetch from firebase
.then(response => {
return response.json(); //returns json from domainURL
})
.then(data => {
const resultArray = []; //defined a resultarray to store the data
for (let key in data){
resultArray.push(data[key]); //pushed data into resultarray             
}
this.users = resultArray; 
});
},

最新更新