0๐
i seems there is an issue with the request. In my opinion, it should change to
axios
.post('http://127.0.0.1:8000/api/studies', addStudy)
.then((result)=>{
this.$store.commit("addStudie", {projet : this.newStudy.currentIdProject, study :result
})
})
if you have any problem place let me know
0๐
You can save your ID in the localStorage
that saves key
value
string data on the client side (browser)
addStudie(state , id) {
// do somthing with state then save it into localStorage
localStorage.setItem('myID', id);
}
And a store getter that returns the id from localStorage
theId(state) {
const savedID = localStorage.getItem("myID")
return savedID
}
if(theId()){
// do something with your ID
}
else{
// ID is not saved in the localStorage yet , call the API
getDataFromAPI()
}
- [Vuejs]-Wowjs and Animate.css is not working with VUEJS
- [Vuejs]-Passing object to component using v-for
Source:stackexchange.com