Add list creation functionality
This commit is contained in:
parent
3d18dd7e47
commit
bacb6c8fb3
6 changed files with 258 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue