Skip to content

Instantly share code, notes, and snippets.

@Musinux
Created September 4, 2019 15:23
Show Gist options
  • Save Musinux/d75bcb2f94173b5ef58afb359ee3134f to your computer and use it in GitHub Desktop.
Save Musinux/d75bcb2f94173b5ef58afb359ee3134f to your computer and use it in GitHub Desktop.
<template>
<v-container>
<v-layout text-center wrap>
<v-form v-model="valid">
<v-container>
<v-row>
<v-col cols="12" md="4">
<v-text-field
v-model="title"
label="Title"
required
></v-text-field>
</v-col>
<v-col cols="12" md="4">
<v-text-field
v-model="content"
label="Content"
required
></v-text-field>
</v-col>
<v-col>
<v-btn v-on:click="addTodo">Add</v-btn>
</v-col>
</v-row>
</v-container>
</v-form>
</v-layout>
</v-container>
</template>
<script>
export default {
data: () => ({
valid: false,
title: '',
content: '',
todoList: []
}),
methods: {
addTodo () {
// TODO
this.todoList.push({
title: this.title,
content: this.content
})
console.log(JSON.stringify(this.todoList))
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment