Открытие большой картинки

This commit is contained in:
iriska-gri committed 2023-12-14 16:58:34 +03:00
1 parent 18e8943d25
commit 2ccf8903f8
1 file changed
+51 -30
+51 -30
View File
@@ -60,12 +60,16 @@
</v-col>
</v-row>
</v-card-title>
<my-helper :pretext="newsFull"/>
<!-- -->
<v-img
:src="`${burl}${newsFull.link}`"
height="450px"
width="96%"
class="mx-auto"
cover
@click="openOneImg(newsFull.link)"
/>
</v-card>
</v-col>
@@ -397,6 +401,42 @@
</v-card>
</v-dialog>
<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>
</div>
@@ -425,6 +465,7 @@ export default {
const route = useRoute()
const newsFull=ref([])
const gallery = ref(false)
const burl = baseURL.slice(0,-1)
const loadNews = () => {
@@ -494,6 +535,7 @@ export default {
// ------------------------------ Галерея
const galleryimges=ref([])
const dialogfoto = ref(false)
const dialogfotoOne = ref(false)
const indximg = ref('')
const openImg = (idimg) => {
@@ -501,6 +543,13 @@ export default {
indximg.value = newsFull.value.gallery.findIndex(e=>e.id == idimg)
}
const openOneImg = (idimg) => {
dialogfotoOne.value = true
galleryimges.value = idimg
console.log(idimg);
}
watch(()=>indximg ,(newValue,oldValue)=>{
if(newValue){
galleryimges.value = newsFull.value.gallery[newValue.value]
@@ -535,36 +584,7 @@ export default {
}
const downloadimg = (idimg) => {
console.log(burl+idimg)
const link = document.createElement('a');
// link.href = burl+idimg
// link.setAttribute('download', 'file.jpg'); //or any other extension
// document.body.appendChild(link);
// link.click();
// let link = document.createElement("a")
// link.href = burl+idimg
// link.setAttribute("download", "image.jpeg");
// document.body.appendChild(link);
// link.download ='img.jpeg'
// link.download('img.jpeg')
// console.log(burl+idimg,'22222222222222222');
// link.remove()
}
// const excelOp = (ex) => {
// axiosApiInstance.get(`api/general_vacation/dailyroundup/?excel=${ex}`).then(result => {
// let link = document.createElement("a")
// link.href = baseURL+result.data.path
// link.click()
// link.remove()
// })
// }
return {
route,
newsFull,
@@ -588,7 +608,8 @@ export default {
galleryimges,
indximg,
toggleIncrementLike,
downloadimg
openOneImg,
dialogfotoOne
}
}