2017-08-16 23 views

回答

0

该解决方案可以帮助你是VUE资源的:

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; 
     }); 
    }, 
+0

可以请你添加注释在上面的回答 –

+0

如果你需要我的VUE资源例如完整的项目代码,在这里是 - https://github.com/Meetzaveri/Vue.js-with-Vue-resource-and-firebase –

+0

Vue-resource从vue 2.0中删除? –