在vue

时间:2017-08-16 07:27:19

标签: parameters vue.js

您好我在点击任务名称时尝试获取任务的详细信息get api应该将任务名称作为参数并返回任务详细信息我无法在我的api中传递参数

1 个答案:

答案 0 :(得分:0)

此解决方案可以帮助您获得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; 
        });
    },