Update VoteHomePage.vue

This commit is contained in:
Nukeap committed 2025-01-20 12:32:35 +03:00
1 parent c3db88e4b6
commit 204d23c197
1 file changed
+9 -17
+9 -17
View File
@@ -16,7 +16,7 @@
<!-- Текущие голосования --> <!-- Текущие голосования -->
<!-- <v-tabs-window v-model="currentTab"> --> <!-- <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-row class="mx-2">
<v-col <v-col
v-for="voting in sortedCurrentVotes" v-for="voting in sortedCurrentVotes"
@@ -48,20 +48,7 @@
md="4" md="4"
:class="{ 'voted-card': voting.voted }" :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-col>
</v-row> </v-row>
</v-container> </v-container>
@@ -128,12 +115,12 @@ export default {
components: { CurrentVote, VoteConstructor, VoteCardVue }, components: { CurrentVote, VoteConstructor, VoteCardVue },
setup() { setup() {
const tabs=[ const tabs=[
{value:"current", text:'Текущие голосования'}, {value:"active", text:'Текущие голосования'},
{value:"completed", text:'Завершенные голосования'}, {value:"completed", text:'Завершенные голосования'},
{value:"constructor", text:'Создать новое голосование'}, {value:"constructor", text:'Создать новое голосование'},
] ]
const currentTab = ref("current"); const currentTab = ref("active");
const votes = ref([]); const votes = ref([]);
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@@ -206,6 +193,11 @@ export default {
console.error("Ошибка при удалении голосования:", error); console.error("Ошибка при удалении голосования:", error);
} }
}; };
watch(currentTab,
async () =>
// console.log(currentTab.value)
await updating(currentTab.value)
)
watch( watch(
() => route, () => route,