Update VoteHomePage.vue
This commit is contained in:
1 parent
c3db88e4b6
commit
204d23c197
1 file changed
+9
-17
@@ -16,7 +16,7 @@
|
||||
<!-- Текущие голосования -->
|
||||
<!-- <v-tabs-window v-model="currentTab"> -->
|
||||
<!-- Текущие голосования -->
|
||||
<v-tabs-window-item value="current" class="h-100 overflow-auto">
|
||||
<v-tabs-window-item value="active" class="h-100 overflow-auto">
|
||||
<v-row class="mx-2">
|
||||
<v-col
|
||||
v-for="voting in sortedCurrentVotes"
|
||||
@@ -48,20 +48,7 @@
|
||||
md="4"
|
||||
:class="{ 'voted-card': voting.voted }"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title>{{ voting.title }}</v-card-title>
|
||||
<v-card-subtitle>
|
||||
Завершено: {{ formatDate(voting.endDate) }}
|
||||
</v-card-subtitle>
|
||||
<v-card-actions class="justify-space-between">
|
||||
<v-btn color="teal-darken-4" size="medium" @click="(voting) => openModal('results', voting)">
|
||||
Результаты
|
||||
</v-btn>
|
||||
<v-btn color="error" size="medium" @click="deleteVoting(voting.id)">
|
||||
<v-icon>mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
@@ -128,12 +115,12 @@ export default {
|
||||
components: { CurrentVote, VoteConstructor, VoteCardVue },
|
||||
setup() {
|
||||
const tabs=[
|
||||
{value:"current", text:'Текущие голосования'},
|
||||
{value:"active", text:'Текущие голосования'},
|
||||
{value:"completed", text:'Завершенные голосования'},
|
||||
{value:"constructor", text:'Создать новое голосование'},
|
||||
|
||||
]
|
||||
const currentTab = ref("current");
|
||||
const currentTab = ref("active");
|
||||
const votes = ref([]);
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
@@ -206,6 +193,11 @@ export default {
|
||||
console.error("Ошибка при удалении голосования:", error);
|
||||
}
|
||||
};
|
||||
watch(currentTab,
|
||||
async () =>
|
||||
// console.log(currentTab.value)
|
||||
await updating(currentTab.value)
|
||||
)
|
||||
|
||||
watch(
|
||||
() => route,
|
||||
|
||||
Reference in new issue
Block a user