0👍
Pass the route as parameter so you can reuse the same function, and the input should also be a parameter, you are trying to post (nothing)
store(route, input) {
if(input != '') {
this.$http.post(route, input)
.then(resp => {
this.post = []; // empty your session post object
window.setTimeout(function(){ window.location =
resp.body.redirect },5); // redirect
})
}
},
- [Vuejs]-Using multiple filters in v-for directive in Vue 2.0
- [Vuejs]-What's the easiest way to implement routes in vue.js?
Source:stackexchange.com