F
F
fessss2020-11-09 18:17:29
Vue.js
fessss, 2020-11-09 18:17:29

Fake data when requesting vue?

Maybe there is some library that, when requested. intercepts the answer and gives me the data from the file for example?
What is the best way to write the front, while the back is not ready, but you already know the data model?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-11-09
@fessss

Why a library? Decide on the data format and go ahead)))
Before developing the back, I just indicated json
Example:

mounted: function(){
    axios
      .get('http://localhost:8080/static/MainData.json')
      .then(response=>(this.MainData=response.data.filter(function(e){
        return e.Deadlines.length >0;
      })
      ))
      .catch(error=>console.log(error));
  },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question