Swiper组件中Swiper.Item组件位置异常
rexjz opened this issue · 1 comments
rexjz commented
测试Swiper组件时,Sipwe.Item的位置位于屏幕之外
js:
import * as React from "react";
import {Image, View} from 'remax/wechat';
import styles from './clubs.css';
import {Swiper as AnnarSwiper} from "annar";
export default class ClubsPage extends React.Component {
render(){
return(
<View className={styles.clubsPage}>
<AnnarSwiper autoplay = 'true' autoplayInterval = '3000'
height='300px'
size = 'middle'
showIndicators='true'
shape = 'sharp'
>
<AnnarSwiper.Item className={styles.SwiperItem}>
<Image style = 'height:100%;width:100%'src ="/images/test.png"/>
</AnnarSwiper.Item>
<AnnarSwiper.Item >
<Image style = 'height:100%;width:100%' src ="/images/test.png"/>
</AnnarSwiper.Item>
</AnnarSwiper>
</View>
)
}
}
css:
.clubsPage{
background-color: #8FCAF7;
}
.SwiperItem{
height: 100px;
width:300px;
}
渲染后只有外框:
AnnaSearl commented
不需要给SwiperItem设置宽度哦,SwiperItem会自动填满父元素(Swiper)的哦