Add list creation functionality

This commit is contained in:
Sol Fisher Romanoff 2022-06-16 01:52:24 +03:00
parent 3d18dd7e47
commit bacb6c8fb3
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62
6 changed files with 258 additions and 3 deletions

View file

@ -1,8 +1,15 @@
import ListCard from '../list_card/list_card.vue'
import ListNew from '../list_new/list_new.vue'
const Lists = {
data () {
return {
isNew: false
}
},
components: {
ListCard
ListCard,
ListNew
},
created () {
this.$store.dispatch('startFetchingLists')
@ -11,6 +18,14 @@ const Lists = {
lists () {
return this.$store.state.api.lists
}
},
methods: {
cancelNewList () {
this.isNew = false
},
newList () {
this.isNew = true
}
}
}

View file

@ -1,9 +1,21 @@
<template>
<div class="settings panel panel-default">
<div v-if="isNew">
<ListNew @cancel="cancelNewList" />
</div>
<div
v-else
class="settings panel panel-default"
>
<div class="panel-heading">
<div class="title">
{{ $t('lists.lists') }}
</div>
<button
class="button-default"
@click="newList"
>
{{ $t("lists.new") }}
</button>
</div>
<div class="panel-body">
<ListCard