Add /notes/new page

This commit is contained in:
2020-07-06 16:09:00 +02:00
parent eb2b7e5cdd
commit a6913c11aa
3 changed files with 58 additions and 12 deletions
+5
View File
@@ -1,6 +1,11 @@
<template>
<div class="container p-4 mx-auto bg-gray-800">
<h1 class="text-center">My Notes</h1>
<nuxt-link
to="/notes/new"
class="bg-blue-700 hover:bg-blue-500 text-white font-bold py-2 px-4 rounded"
>New note</nuxt-link
>
<input
id="search"
name="search"
+44
View File
@@ -0,0 +1,44 @@
<template>
<div class="container mx-auto">
<form @submit.prevent="submit">
<textarea
v-model="content"
aria-label="markdown input"
name="content"
rows="30"
style="outline: none !important;"
class="w-full bg-gray-800 p-5"
spellcheck="false"
></textarea>
<button
class="block bg-blue-700 hover:bg-blue-500 text-white font-bold py-2 px-4 rounded"
type="submit"
>
Save
</button>
</form>
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
name: 'New',
data: () => ({
title: 'Test',
tags: [],
content: '',
}),
methods: {
...mapActions('notes', ['create']),
submit() {
this.create({
title: this.title,
tags: this.tags,
content: this.content,
})
},
},
}
</script>