Submit notes
This commit is contained in:
parent
5560298388
commit
765f96cedf
@ -9,40 +9,39 @@
|
|||||||
<v-toolbar-title>Create a note</v-toolbar-title>
|
<v-toolbar-title>Create a note</v-toolbar-title>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
|
|
||||||
<v-card-text>
|
|
||||||
<v-text-field label="Title" outlined value="My new note"></v-text-field>
|
|
||||||
|
|
||||||
<v-textarea
|
<v-form
|
||||||
label="Text"
|
ref="form"
|
||||||
outlined
|
v-model="valid"
|
||||||
counter
|
lazy-validation
|
||||||
loader-height="5"
|
>
|
||||||
spellcheck="false"
|
<v-card-text>
|
||||||
value="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse"
|
<v-text-field label="Title" v-model="form.title" outlined value="My new note"></v-text-field>
|
||||||
></v-textarea>
|
|
||||||
|
|
||||||
<v-combobox
|
<v-combobox
|
||||||
outlined
|
outlined
|
||||||
v-model="tags"
|
v-model="form.tags"
|
||||||
:items="possibleTags"
|
:items="possibleTags"
|
||||||
:delimiters="delimiters"
|
:delimiters="delimiters"
|
||||||
label="Tags"
|
label="Tags"
|
||||||
multiple
|
multiple
|
||||||
chips
|
chips
|
||||||
deletable-chips
|
deletable-chips
|
||||||
></v-combobox>
|
></v-combobox>
|
||||||
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn
|
<v-btn
|
||||||
color="success"
|
color="success"
|
||||||
depressed
|
depressed
|
||||||
>
|
@click="createNote"
|
||||||
Create
|
>
|
||||||
</v-btn>
|
Create
|
||||||
</v-card-actions>
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-form>
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -51,9 +50,29 @@
|
|||||||
name: "create",
|
name: "create",
|
||||||
data: () => ({
|
data: () => ({
|
||||||
delimiters: [" ", ","],
|
delimiters: [" ", ","],
|
||||||
tags: [],
|
form: {
|
||||||
possibleTags: ["Dev", "Ephec", "Java"]
|
title: '',
|
||||||
})
|
tags: []
|
||||||
|
},
|
||||||
|
possibleTags: []
|
||||||
|
}),
|
||||||
|
methods: {
|
||||||
|
createNote() {
|
||||||
|
this.$axios.post(`/notes/${this.form.title}`, {
|
||||||
|
tags: this.form.tags
|
||||||
|
}).then(data => {
|
||||||
|
console.log(data)
|
||||||
|
}
|
||||||
|
).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$axios.get("/tags")
|
||||||
|
.then(e => console.log(e.data))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user