Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2019-12-21 09:57:18 +0300
committerdartcafe <github@dartcafe.de>2019-12-21 09:57:18 +0300
commit515e06cad58583f35ccd5d09fe3d98ea14cfd5d3 (patch)
treec2bee99e482d8dc711662b5dbbd654cfa489e153 /src/js/views/PollList.vue
parent1ac2ea100eaf5e270acd5f1e795952ee83647e6c (diff)
fixed routing
Diffstat (limited to 'src/js/views/PollList.vue')
-rw-r--r--src/js/views/PollList.vue32
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()
},