Update carousel-list.vue
This commit is contained in:
1 parent
2f5ccc6263
commit
bcff918b60
1 file changed
+25
-7
@@ -1,13 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
|
{{ intervalcomp }}
|
||||||
<v-carousel
|
<v-carousel
|
||||||
|
v-model="currentslide"
|
||||||
interval="10000"
|
:interval="intervalcomp"
|
||||||
cover
|
cover
|
||||||
|
|
||||||
height="450"
|
height="450"
|
||||||
hide-delimiters
|
hide-delimiters
|
||||||
hide-delimiter-background
|
hide-delimiter-background
|
||||||
:show-arrows="carous.length<2?false:'hover'"
|
:show-arrows="carous.length<2?false:'hover'"
|
||||||
color="white"
|
color="white"
|
||||||
|
@update:modelValue="intervalcomp=10000"
|
||||||
>
|
>
|
||||||
|
|
||||||
<template v-for="(x, i) in carous" :key="i">
|
<template v-for="(x, i) in carous" :key="i">
|
||||||
@@ -71,22 +74,26 @@
|
|||||||
|
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<video
|
<video
|
||||||
style="height: 450px;"
|
ref="videoElement"
|
||||||
|
style="height: 450px;width: 100%;"
|
||||||
controls
|
controls
|
||||||
|
autoplay
|
||||||
|
preload="metadata"
|
||||||
|
@loadedmetadata="intervalcomp = videoElement[currentslide].duration"
|
||||||
>
|
>
|
||||||
<source :src="`${burl}${x.link}`" type="video/mp4" />
|
<source :src="`${burl}${x.link}`" type="video/mp4" />
|
||||||
|
|
||||||
Текущий браузер не поддерживает воспроизведение этого видео.
|
Текущий браузер не поддерживает воспроизведение этого видео.
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</v-carousel-item>
|
</v-carousel-item>
|
||||||
</template>
|
</template>
|
||||||
</v-carousel>
|
</v-carousel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { baseURL } from "@/utils/axios-api";
|
import { baseURL } from "@/utils/axios-api";
|
||||||
import { axiosApiInstance } from "@/utils/axios-api";
|
import { axiosApiInstance } from "@/utils/axios-api";
|
||||||
import { useAlertStore } from "@/store/useAlertStore";
|
import { useAlertStore } from "@/store/useAlertStore";
|
||||||
@@ -94,9 +101,9 @@ import { useAlertStore } from "@/store/useAlertStore";
|
|||||||
export default {
|
export default {
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
|
const currentslide=ref(0)
|
||||||
const burl = baseURL.slice(0, -1);
|
const burl = baseURL.slice(0, -1);
|
||||||
|
const videoElement=ref(null)
|
||||||
const carous = ref([{ link: `/media/newsimage/scales.jpg`, "title": null, "text": "" }]);
|
const carous = ref([{ link: `/media/newsimage/scales.jpg`, "title": null, "text": "" }]);
|
||||||
const feedalert = useAlertStore().alert;
|
const feedalert = useAlertStore().alert;
|
||||||
|
|
||||||
@@ -118,8 +125,19 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getfromserver();
|
getfromserver();
|
||||||
|
const interval=ref(10000)
|
||||||
|
const intervalcomp = computed({get(){
|
||||||
|
return interval.value},
|
||||||
|
set(val){
|
||||||
|
interval.value=val
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
videoElement,
|
||||||
|
currentslide,
|
||||||
|
interval,
|
||||||
|
intervalcomp,
|
||||||
burl,
|
burl,
|
||||||
carous,
|
carous,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user