0👍
Just add v-model in your input tag and assign an dynamic variable like below.
<input type="text" name="delivery_time" value="insert delivery time" v-model="<deliveryTime>">
V-model directive works as two way data binding hence whenever you will do any changes in input tag, it will get automatically reflected in variable . This value can be retrieved in your js part of component.
So you just need to pass that value, on the click of submit button.
this.$http.$post(url, {
deliveryTime: deliveryTime
}, {
// Config part( like authtoken
})
- [Vuejs]-Vue v-model changes parent data but doesn't change value prop in custom component
- [Vuejs]-Vuejs notification plugin
-1👍
I don’t have any idea for you way that you are doing.
You can use vue router + axios to handle your authentication.
Let read this to get more idea: https://www.smashingmagazine.com/2020/10/authentication-in-vue-js/
- [Vuejs]-Vue.js webpack and static images (without vuecli and nodejs dev server)
- [Vuejs]-Convert select to vue-select with dynamic data
Source:stackexchange.com