diff options
author | dartcafe <github@dartcafe.de> | 2019-12-21 09:57:18 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2019-12-21 09:57:18 +0300 |
commit | 515e06cad58583f35ccd5d09fe3d98ea14cfd5d3 (patch) | |
tree | c2bee99e482d8dc711662b5dbbd654cfa489e153 /src/js/views/PollList.vue | |
parent | 1ac2ea100eaf5e270acd5f1e795952ee83647e6c (diff) |
fixed routing
Diffstat (limited to 'src/js/views/PollList.vue')
-rw-r--r-- | src/js/views/PollList.vue | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/js/views/PollList.vue b/src/js/views/PollList.vue index 2bf90a6d..4148b48a 100644 --- a/src/js/views/PollList.vue +++ b/src/js/views/PollList.vue @@ -35,7 +35,7 @@ class="table"> <PollListItem key="0" :header="true" /> <li is="PollListItem" - v-for="(poll, index) in pollList" + v-for="(poll, index) in filteredList" :key="poll.id" :poll="poll" @deletePoll="removePoll(index, poll)" @@ -61,8 +61,7 @@ export default { data() { return { noPolls: false, - loading: true, - pollList: this.$store.state.polls.list + loading: true } }, @@ -72,30 +71,25 @@ export default { 'publicPolls', 'hiddenPolls', 'deletedPolls' - ]) + ]), - // pollList() { - // return this.$store.state.polls.list - // } - }, - - watch: { - $route(to, from) { - if (this.$route.params.type === 'all') { - this.pollList = this.$store.state.polls.list - } else if (this.$route.params.type === 'my') { - this.pollList = this.myPolls + filteredList() { + if (this.$route.params.type === 'my') { + return this.myPolls } else if (this.$route.params.type === 'public') { - this.pollList = this.publicPolls + return this.publicPolls } else if (this.$route.params.type === 'hidden') { - this.pollList = this.hiddenPolls + return this.hiddenPolls } else if (this.$route.params.type === 'deleted') { - this.pollList = this.deletedPolls + return this.deletedPolls + } else { + return this.$store.state.polls.list } } + }, - created() { + mounted() { this.refreshPolls() }, |