Created
September 4, 2019 15:23
-
-
Save Musinux/d75bcb2f94173b5ef58afb359ee3134f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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