Add prettier + eslint & reformat/fix files

This commit is contained in:
2020-04-23 17:32:45 +02:00
parent 932a9f8379
commit ebe8e640af
20 changed files with 1371 additions and 419 deletions
+23 -34
View File
@@ -7,25 +7,14 @@
<h1 class="font-weight-bold display-2">Account</h1>
</v-card-title>
<v-tabs
v-model="tab"
background-color="transparent"
dark
grow
>
<v-tab
v-for="tab in tabs"
:key="tab"
>
<v-tabs v-model="tab" background-color="transparent" dark grow>
<v-tab v-for="tab in tabs" :key="tab">
{{ tab }}
</v-tab>
</v-tabs>
<v-tabs-items v-model="tab">
<v-tab-item
v-for="tab in tabs"
:key="tab"
>
<v-tab-item v-for="tab in tabs" :key="tab">
<v-card flat>
<v-card-text>
<LoginForm v-if="tab === 'Login'"></LoginForm>
@@ -38,25 +27,25 @@
</template>
<script>
import LoginForm from "~/components/LoginForm";
import RegisterForm from "~/components/RegisterForm";
import LoginForm from '~/components/LoginForm'
import RegisterForm from '~/components/RegisterForm'
export default {
name: "centered",
layout: "centered",
options: {
auth: 'guest',
},
data: () => ({
tab: 0,
tabs: ["Login", "Register"]
}),
head: () => ({
title: "Account"
}),
components: {
LoginForm,
RegisterForm
}
}
export default {
name: 'Centered',
layout: 'centered',
options: {
auth: 'guest',
},
components: {
LoginForm,
RegisterForm,
},
data: () => ({
tab: 0,
tabs: ['Login', 'Register'],
}),
head: () => ({
title: 'Account',
}),
}
</script>
+44 -52
View File
@@ -1,11 +1,6 @@
<template>
<v-card>
<v-toolbar
flat
color="secondary"
class="mt-12"
dark
>
<v-toolbar flat color="secondary" class="mt-12" dark>
<v-toolbar-title>Create a note</v-toolbar-title>
</v-toolbar>
@@ -13,16 +8,18 @@
A note with the same title already exists
</v-alert>
<v-form
ref="form"
lazy-validation
>
<v-form ref="form" lazy-validation>
<v-card-text>
<v-text-field label="Title" v-model="form.title" outlined value="My new note"></v-text-field>
<v-text-field
v-model="form.title"
label="Title"
outlined
value="My new note"
></v-text-field>
<v-combobox
outlined
v-model="form.tags"
outlined
:items="possibleTags"
:delimiters="delimiters"
label="Tags"
@@ -30,16 +27,11 @@
chips
deletable-chips
></v-combobox>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="success"
depressed
@click="createNote"
>
<v-btn color="success" depressed @click="createNote">
Create
</v-btn>
</v-card-actions>
@@ -48,45 +40,45 @@
</template>
<script>
export default {
name: "create",
data: () => ({
delimiters: [" ", ","],
form: {
title: '',
tags: []
},
possibleTags: [],
conflict: false
}),
methods: {
createNote() {
this.conflict = false
this.$axios.post(`/notes/${this.form.title}`, {
tags: this.form.tags
}).then(_ => {
this.$router.push("/notes")
}
).catch(e => {
export default {
name: 'Create',
data: () => ({
delimiters: [' ', ','],
form: {
title: '',
tags: [],
},
possibleTags: [],
conflict: false,
}),
mounted() {
this.$axios
.get('/tags')
.then((e) => (this.possibleTags = e.data))
.catch((e) => {
console.log(e)
})
},
methods: {
createNote() {
this.conflict = false
this.$axios
.post(`/notes/${this.form.title}`, {
tags: this.form.tags,
})
.then((_) => {
this.$router.push('/notes')
})
.catch((e) => {
if (e.response && e.response.status === 409) {
this.conflict = true
} else {
console.log("??")
console.log('??')
}
})
}
},
mounted() {
this.$axios.get("/tags")
.then(e => this.possibleTags = e.data)
.catch(e => {
console.log(e)
})
}
}
},
}
</script>
<style scoped>
</style>
<style scoped></style>
+12 -13
View File
@@ -3,21 +3,20 @@
</template>
<script>
export default {
export default {
title: 'Home',
options: {
auth: false,
},
data: () => ({}),
head: () => ({
title: 'Home',
options: {
auth: false
},
data: () => ({}),
head: () => ({
title: "Home"
})
}
}),
}
</script>
<style>
body {
background-color: #1565c0;
}
body {
background-color: #1565c0;
}
</style>
+16 -31
View File
@@ -1,22 +1,15 @@
<template>
<v-card flat>
<v-toolbar
color="primary"
dark
extended
prominent
>
<v-toolbar color="primary" dark extended prominent>
<v-app-bar-nav-icon></v-app-bar-nav-icon>
<v-toolbar-title>Notes</v-toolbar-title>
</v-toolbar>
<v-card
class="mx-auto"
max-width="700"
style="margin-top: -64px;"
>
<v-card class="mx-auto" max-width="700" style="margin-top: -64px;">
<v-toolbar flat>
<v-toolbar-title class="grey--text">Create a note</v-toolbar-title>
<v-toolbar-title class="grey--text"
>Create a note</v-toolbar-title
>
</v-toolbar>
<v-divider></v-divider>
@@ -45,14 +38,8 @@
<v-divider></v-divider>
<v-card-actions>
<v-btn
color="success"
class="mx-auto"
depressed
block
>
<v-btn color="success" class="mx-auto" depressed block>
Create
</v-btn>
</v-card-actions>
@@ -61,17 +48,15 @@
</template>
<script>
export default {
name: "new",
layout: "empty",
data: () => ({
delimiters: [" ", ","],
tags: [],
possibleTags: ["Dev", "Ephec", "Java"]
})
}
export default {
name: 'New',
layout: 'empty',
data: () => ({
delimiters: [' ', ','],
tags: [],
possibleTags: ['Dev', 'Ephec', 'Java'],
}),
}
</script>
<style scoped>
</style>
<style scoped></style>
+6 -6
View File
@@ -30,19 +30,19 @@
</template>
<script>
import Note from '@/components/Note';
import { format } from 'timeago.js';
import { format } from 'timeago.js'
import Note from '@/components/Note'
export default {
name: 'notes',
name: 'Notes',
title: 'Notes',
components: { Note },
data: () => ({
notes: [],
}),
methods: { format },
mounted() {
this.$axios.get('/notes').then(e => (this.notes = e.data));
this.$axios.get('/notes').then((e) => (this.notes = e.data))
},
};
methods: { format },
}
</script>