|
@@ -11,7 +11,7 @@
|
|
import {onMounted,ref,reactive,watch} from 'vue'
|
|
import {onMounted,ref,reactive,watch} from 'vue'
|
|
import indexMain from '@/components/index/indexMain.vue'
|
|
import indexMain from '@/components/index/indexMain.vue'
|
|
import CustomCarousel from '@/components/index/custom-carousel.vue'
|
|
import CustomCarousel from '@/components/index/custom-carousel.vue'
|
|
-
|
|
|
|
|
|
+import {isElView} from '@/views/util/util.js'
|
|
import {getCarouselList} from '@/http/api/common.js'
|
|
import {getCarouselList} from '@/http/api/common.js'
|
|
// const props = defineProps({
|
|
// const props = defineProps({
|
|
// RouterViewTop: {
|
|
// RouterViewTop: {
|
|
@@ -39,13 +39,14 @@ onMounted(async() => {
|
|
if (res?.data?.rows) {
|
|
if (res?.data?.rows) {
|
|
let List = []
|
|
let List = []
|
|
res.data.rows.forEach(item =>{
|
|
res.data.rows.forEach(item =>{
|
|
- if (item?.carouselUrlList[0]) {
|
|
|
|
|
|
+ if (item?.carouselUrlList && item?.carouselUrlList[0]) {
|
|
List.push(item?.carouselUrlList[0])
|
|
List.push(item?.carouselUrlList[0])
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
carouselList.value = List
|
|
carouselList.value = List
|
|
- console.log(List);
|
|
|
|
|
|
+
|
|
|
|
+ //获取轮播图后 自动刷新一次组件dom
|
|
|
|
+ isElView()
|
|
}
|
|
}
|
|
});
|
|
});
|
|
const carouselList = ref([])
|
|
const carouselList = ref([])
|