Новости

This commit is contained in:
iriska-gri committed 2023-12-13 13:30:24 +03:00
1 parent 1878b19462
commit f4da4b8fa3
5 files changed
+90 -11

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@ export default {
const loadNewsAll = () => {
axiosApiInstance.get( `api/navigation/newscrossroad/?name=${route.path}&page=${page.value-1}&countpage=${countpage.value}`).then(result => {
newsAll.value= result.data.result
countetnews.value = result.data.countpage
countetnews.value = result.data.countpage/countpage.value
}
)
}
+1 -2
View File
@@ -1,5 +1,4 @@
<template>
<div>{{route.query['id']}}</div>
</template>
@@ -15,7 +14,7 @@ export default {
return {
route
}
}
+78
View File
@@ -0,0 +1,78 @@
<template>
<v-row>
<v-col class="flex-column d-flex">
<v-row class="flex-grow-0 ma-3 mb-0">
<v-col class="flex-column d-flex pa-0 flex-wrap">
Всего новостей: {{countetnews}}
</v-col>
</v-row>
<v-row class="mt-0 h-0 overflow-auto">
<v-col
v-for="(x, key) in newsAll"
:key="key"
class="pb-1 pt-0">
<news-card :news="x"/>
</v-col>
</v-row>
</v-col>
</v-row>
<!-- <div>
<div class= "pa-3">
Всего новостей: {{countetnews}}
</div>
<div
v-for="(x, key) in newsAll"
:key="key"
class="pb-2"
>
<news-card :news="x"/>
</div>
</div> -->
</template>
<script>
import { ref } from 'vue'
import { axiosApiInstance } from '@/utils/axios-api'
import { useRoute } from 'vue-router'
import newsCard from './UI/news-card.vue'
export default {
components: {
newsCard
},
setup(){
const newsAll=ref([])
const countetnews = ref(0)
const page = ref(1)
const countpage = ref(8)
const route = useRoute()
const loadNewsAll = () => {
axiosApiInstance.get( `api/navigation/newscrossroad/?name=${route.path}&page=${page.value-1}&countpage=${countpage.value}`).then(result => {
newsAll.value= result.data.result
countetnews.value = result.data.countpage
}
)
}
loadNewsAll()
return {
newsAll,
countetnews,
page,
countpage,
loadNewsAll,
}
}
}
</script>
<style>
</style>
+7 -5
View File
@@ -32,10 +32,10 @@
<v-card class="h-100 d-flex flex-column">
<v-row class="d-flex h-0 overflow-auto">
<v-col>
<News-list-home />
<v-row class="d-flex">
<v-col class="flex-column d-flex">
<news-home/>
<!-- <News-list-home /> -->
</v-col>
</v-row>
</v-card>
@@ -86,6 +86,7 @@
import CarouselNumbers from '@/components/carousel-numbers.vue'
import CalendarFull from '@/components/UI/Calendar-full.vue'
import NewsListHome from '@/components/news-list-home.vue'
import NewsHome from '@/components/news-home.vue'
import LoadRound from '@/components/load-round.vue'
import DigitalLetna from '@/components/digital-letna.vue'
import { axiosApiInstance } from '@/utils/axios-api'
@@ -102,7 +103,8 @@
NewsListHome,
LoadRound,
DigitalLetna,
EventCalendar
EventCalendar,
NewsHome
},