<swiper-item v-for="item in 4" :key="item">
<view class="swiper-item uni-bg-red">A ---{{ item }}</view>
</swiper-item>
</swiper>
</view>
<!-- </view> -->
</template>
<script>
export default {
name: "swiper",
data() {
return {
};
},
props: {
indicatorDots: {
type: Boolean,
default: true
},
autoplay: {
type: Boolean,
default: true
},
interval: {
type: Number,
default: 2000
},
duration: {
type: Number,
default: 500
}
},
methods: {
},
};
</script>
<style lang="scss" scoped>
.swiper-con {
.swiper {
height: 300rpx;
}
.swiper-item {
display: block;
height: 300rpx;
line-height: 300rpx;
text-align: center;
}
.swiper-list {
margin-top: 40rpx;
margin-bottom: 0;
}
.uni-swiper-dot {
width: 10rpx;
height: 4rpx;
}
.uni-swiper-dot-active {
width: 40rpx;
border-radius: 6rpx;
}
}
</style>
c***@wu-huan.cn (作者)
我做了一个延迟加载,APP 就正常了。。。。
2024-12-05 11:14
c***@wu-huan.cn (作者)
你的方法,我也试试
2024-12-05 11:15
爱豆豆
回复 c***@wu-huan.cn: 不应该啊 能不能发个复现的demo 我在试试
2024-12-05 11:16
爱豆豆
回复 c***@wu-huan.cn: 你props已经写了默认值 就算数据有延迟 也不会影响到组件的加载
2024-12-05 11:17
c***@wu-huan.cn (作者)
试过了,name别交swiper 就行
2024-12-05 11:20
c***@wu-huan.cn (作者)
回复 c***@wu-huan.cn: 不用延迟加载
2024-12-05 11:21
爱豆豆
回复 c***@wu-huan.cn: 嗯嗯
2024-12-05 11:54