Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div>
- <form @submit.prevent="saveData">
- <div class="input-group mb-3">
- <input v-model="form.title" type="text" class="form-control form-control-lg" aria-label="Recipient's username" aria-describedby="button-addon2">
- <div class="input-group-append">
- <button class="btn btn-success" type="submit" id="button-addon2">Add List </button>
- </div>
- </div>
- </form>
- </div>
- </template>
- <script>
- export default {
- data(){
- return{
- form: new Form({
- title: '',
- })
- }
- },
- methods:{
- saveData(){
- let data = new FormData();
- data.append('title', this.form.title)
- axios.post('/api/todo', data)
- }
- },
- mounted() {
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement