源码、数据是下面这个
<template>
<view><customSwiper :swiper-list="swiperList" /></view>
</template>
<script>
import customSwiper from '@/components/blackmonth-swiper/index'
export default {
data() {
return {
title: 'hi',
swiperList: [],
background: ['color1', 'color2', 'color3'],
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500
}
},
onLoad() {
this.test()
},
methods: {
test(){
uni.request({
url:'http://127.0.0.1/index.php?act=list',
header: {'content-type':'application/json'},
success: (res) => {
this.swiperList=res.data.data.list;
}
})
}
},
components: {customSwiper}
}
</script>
<style scoped lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
.uni-form-item .title {
padding: 20rpx 0;
}
</style>
{"errno":0,"message":"\\u8bf7\\u6c42\\u6210\\u529f\\uff01","data":{"list":[{"type":"image","url":"https:\/\/ossweb-img.qq.com\/images\/lol\/web201310\/skin\/big84000.jpg"},{"type":"image","url":"https:\/\/ossweb-img.qq.com\/images\/lol\/web201310\/skin\/big37006.jpg"},{"type":"image","url":"https:\/\/ossweb-img.qq.com\/images\/lol\/web201310\/skin\/big39000.jpg"},{"type":"image","url":"https:\/\/ossweb-img.qq.com\/images\/lol\/web201310\/skin\/big10001.jpg"},{"type":"image","url":"https:\/\/ossweb-img.qq.com\/images\/lol\/web201310\/skin\/big25011.jpg"},{"type":"image","url":"yyyy"}]},"total":6}
3 个回复
y***@163.com
打印出多少数据
w***@qq.com (作者)
打印的数据有5条,程序打开的时候,其实看到了有五张图片,它们迅速的叠在一起了,就是不滚动...
Blackmonth丶
源码和测试数据方便发一下么?
2020-02-24 10:47
w***@qq.com (作者)
回复 Blackmonth丶: 亲!!!源码和测试数据在下面!!!!
2020-02-24 11:47
w***@qq.com (作者)
源码、数据是下面这个