Answer the question
In order to leave comments, you need to log in
Why is vue not finding the file?
There is a method that sends an array to node, it is converted to a string and placed in json
postJson(url, data){
return fetch(url, {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
})
.then(() => JSON.stringify(data))
},
this.postJson("todo.json", this.todos)
fetch('todo.json')
.then(result => result.json())
.then(data => {
this.todos = data;
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question