|
@@ -1,58 +1,72 @@
|
|
|
<template>
|
|
|
- <swiper :modules="modules" :space-between="38" :scrollbar="{ draggable: true }" :freeMode="true" :observer="true"
|
|
|
- :mousewheel="true" :grid="{
|
|
|
+ <swiper
|
|
|
+ :modules="modules"
|
|
|
+ :space-between="38"
|
|
|
+ :scrollbar="{ draggable: true }"
|
|
|
+ :freeMode="true"
|
|
|
+ :observer="true"
|
|
|
+ :mousewheel="true"
|
|
|
+ :grid="{
|
|
|
rows: 2,
|
|
|
- }" :slidesPerView="'auto'" @reachEnd="onReachEnd" @swiper="onSwiper" @slideChange="onSlideChange">
|
|
|
- <swiper-slide @click="onClickItem(item)" class='slide-item' v-for="item in list" :key="item">
|
|
|
- <img v-lazy="`${$config.MODELLINKPERFIX}${item.thumb}`" :src="`${$config.MODELLINKPERFIX}${item.thumb}`" alt="">
|
|
|
- <span :title="item.name" class='i-name van-ellipsis'>{{ item.name }}</span>
|
|
|
+ }"
|
|
|
+ :slidesPerView="'auto'"
|
|
|
+ @reachEnd="onReachEnd"
|
|
|
+ @swiper="onSwiper"
|
|
|
+ @slideChange="onSlideChange"
|
|
|
+ >
|
|
|
+ <swiper-slide
|
|
|
+ @click="onClickItem(item)"
|
|
|
+ class="slide-item"
|
|
|
+ v-for="item in list"
|
|
|
+ :key="item"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ v-lazy="`${$config.MODELLINKPERFIX}${item.thumb}`"
|
|
|
+ :src="`${$config.MODELLINKPERFIX}${item.thumb}`"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <span :title="item.name" class="i-name van-ellipsis">{{
|
|
|
+ item.name
|
|
|
+ }}</span>
|
|
|
</swiper-slide>
|
|
|
</swiper>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { Grid, FreeMode, Mousewheel } from 'swiper';
|
|
|
+import { Grid, FreeMode, Mousewheel } from "swiper";
|
|
|
// Import Swiper Vue.js components
|
|
|
-import { Swiper, SwiperSlide } from 'swiper/vue';
|
|
|
-import { ref } from 'vue';
|
|
|
+import { Swiper, SwiperSlide } from "swiper/vue";
|
|
|
+import { ref } from "vue";
|
|
|
|
|
|
// Import Swiper styles
|
|
|
-import 'swiper/css';
|
|
|
-import 'swiper/css/grid';
|
|
|
-import 'swiper/css/free-mode';
|
|
|
-import 'swiper/css/mousewheel';
|
|
|
+import "swiper/css";
|
|
|
+import "swiper/css/grid";
|
|
|
+import "swiper/css/free-mode";
|
|
|
+import "swiper/css/mousewheel";
|
|
|
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
|
|
|
-
|
|
|
-const router = useRouter()
|
|
|
+const router = useRouter();
|
|
|
|
|
|
const props = defineProps({
|
|
|
- list: Array
|
|
|
-})
|
|
|
-
|
|
|
+ list: Array,
|
|
|
+});
|
|
|
|
|
|
-const emit = defineEmits(['reachEnd'])
|
|
|
+const emit = defineEmits(["reachEnd"]);
|
|
|
|
|
|
-
|
|
|
-const onSwiper = (swiper) => {
|
|
|
-};
|
|
|
-const onSlideChange = () => {
|
|
|
-};
|
|
|
+const onSwiper = (swiper) => {};
|
|
|
+const onSlideChange = () => {};
|
|
|
|
|
|
const onReachEnd = () => {
|
|
|
- emit('reachEnd')
|
|
|
-}
|
|
|
-
|
|
|
-const onClickItem = (item)=>{
|
|
|
- console.log('result:', item);
|
|
|
- router.push({ name: 'CulturalRelics', params: { id: item.id } })
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
+ emit("reachEnd");
|
|
|
+};
|
|
|
|
|
|
-const modules = [Grid, FreeMode, Mousewheel]
|
|
|
+const onClickItem = (item) => {
|
|
|
+ console.log("result:", item.id);
|
|
|
+ // router.push({ path: "/cultural-relics", params: { id: item.id } });
|
|
|
+};
|
|
|
|
|
|
+const modules = [Grid, FreeMode, Mousewheel];
|
|
|
</script>
|
|
|
|
|
|
|
|
@@ -64,7 +78,7 @@ const modules = [Grid, FreeMode, Mousewheel]
|
|
|
width: 100%;
|
|
|
|
|
|
.swiper-wrapper {
|
|
|
- margin: 0!important;
|
|
|
+ margin: 0 !important;
|
|
|
.swiper-slide {
|
|
|
text-align: center;
|
|
|
font-size: 18px;
|
|
@@ -77,9 +91,9 @@ const modules = [Grid, FreeMode, Mousewheel]
|
|
|
overflow: hidden;
|
|
|
box-sizing: border-box;
|
|
|
cursor: pointer;
|
|
|
- background: linear-gradient(180deg, #75736E 0%, #BCBBB8 100%);
|
|
|
+ background: linear-gradient(180deg, #75736e 0%, #bcbbb8 100%);
|
|
|
|
|
|
- >img {
|
|
|
+ > img {
|
|
|
width: 100%;
|
|
|
height: calc(100% - 55px);
|
|
|
object-fit: cover;
|
|
@@ -95,16 +109,17 @@ const modules = [Grid, FreeMode, Mousewheel]
|
|
|
color: #666666;
|
|
|
padding: 0 10px;
|
|
|
box-sizing: border-box;
|
|
|
- background: #FFFFFF;
|
|
|
+ background: #ffffff;
|
|
|
font-size: 24px;
|
|
|
display: inline-block;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}</style>
|
|
|
+}
|
|
|
+</style>
|
|
|
|
|
|
<style>
|
|
|
-.swiper-wrapper{
|
|
|
- margin: 0!important;
|
|
|
+.swiper-wrapper {
|
|
|
+ margin: 0 !important;
|
|
|
}
|
|
|
</style>
|