All files / src/components news-home.vue

0% Statements 0/46
0% Branches 0/4
0% Functions 0/21
0% Lines 0/46

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128                                                                                                                                                                                                                                                               
<template>
    <v-row class="">
        <v-col class="flex-column d-flex pa-0">
            <v-row class="mt-0 mx-3 h-0 overflow-auto ">
                <v-col
                    v-for="(x, key) in newsAll"
                    :key="key"
                    class="py-1"
                    lg=12
                    md=6
                    sm=6
                >
                    <NewsCard :news="x"/>
                    

                    <v-dialog
      v-model="dialogfotoOne"
      width="w-100"
      height="900"
      class="flex-column "
    >
      <v-card class="pa-4 h-100 flex-column d-flex">
              <v-row class="flex-grow-0 justify-end">
              <v-col class="pa-0 flex-grow-0">
                <v-btn
                  density="compact"
                  variant="text"
                  icon="mdi-close"
                  @click="dialogfotoOne = false"
           
             
                />
              </v-col>
            </v-row>
        <v-row>
 
          <v-col  class="flex-column h_cards pa-0">
            <v-img      
              class="d-flex"
              :src="`${burl}${galleryimges}`"
            />
            
          </v-col>

        </v-row>
 
      </v-card>
    </v-dialog>

                </v-col>
            </v-row>
            <v-divider class="mt-3"/>
            <v-row class="flex-grow-0 ma-0 align-items-center">
                <v-col class="flex-column d-flex pa-0 align-end">
                    <v-btn
                        size="small"
                        variant="text"
                        icon="mdi-newspaper"
                        color="blue-darken-4"
                        :to='`/news`'
                    />
                </v-col>
                <v-col class="py-0 pl-0 flex-grow-0 text-end align-self-center text-caption font-weight-bold text-no-wrap">
                    Всего новостей: {{countetnews}} 
                    
                </v-col>
            </v-row>
        </v-col>
    </v-row>
</template>

<script>
import { ref } from 'vue'
import { axiosApiInstance } from '@/utils/axios-api'
import { useRoute } from 'vue-router'
import NewsCard from './UI/NewsCard.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 galleryimges=ref('')
        const dialogfotoOne  = ref(false)
 
        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()

        const openOneImg = (idimg) => {
        dialogfotoOne.value = true 
        galleryimges.value = idimg
    

    }
 
    return {
        newsAll,
        countetnews,
        page,
        countpage,
        loadNewsAll,
        galleryimges,
        dialogfotoOne,
        
    }
    }
}
 
</script>
 
<style>
 
</style>