fixed slider bug

This commit is contained in:
HAM!DREZA
2024-10-10 12:21:36 +03:30
parent e2f859a1bf
commit 2a2e52fd6d
+8 -4
View File
@@ -3,10 +3,12 @@
<template v-for="(btn, i) in btns.arrows" :key="i"> <template v-for="(btn, i) in btns.arrows" :key="i">
<Button v-if="device == 'desktop'" v-bind="btn" /> <Button v-if="device == 'desktop'" v-bind="btn" />
</template> </template>
<Swiper v-bind="swipers.topSlider"> <Swiper
:loop="true"
v-bind="swipers.topSlider">
<SwiperSlide v-for="{ link, images, title, id } in sliders" :key="id"> <SwiperSlide v-for="{ link, images, title, id } in sliders" :key="id">
<router-link :to="link"> <router-link :to="link">
<img :title="title" :src="images[device] + '?w=1980'" /> <img :title="title" :src="images[device]" />
</router-link> </router-link>
</SwiperSlide> </SwiperSlide>
</Swiper> </Swiper>
@@ -17,6 +19,8 @@
const { swipers, btns } = inject('init') const { swipers, btns } = inject('init')
const { device } = inject('service') const { device } = inject('service')
const { sliders } = inject('data') const { sliders } = inject('data')
console.log(sliders, 'sliders');
</script> </script>
<style lang="scss"> <style lang="scss">
@@ -24,7 +28,7 @@ const { sliders } = inject('data')
@apply w-full h-max flex z-0; @apply w-full h-max flex z-0;
.swiper { .swiper {
@apply w-full h-max; @apply w-full h-auto lg:h-[550px];
.swiper-wrapper { .swiper-wrapper {
@apply z-0 h-max bg-gray-50; @apply z-0 h-max bg-gray-50;
@@ -34,7 +38,7 @@ const { sliders } = inject('data')
a { a {
img { img {
@apply w-full object-cover h-full; @apply w-full object-cover h-auto lg:h-[550px];
} }
} }
} }