111
8***@qq.com
- 发布:2019-03-14 11:49
- 更新:2019-03-14 15:21
- 阅读:1648
头部scroll-view做滚动菜单 swiper 做view 怎么初始化 swiper的高度
分类:uni-app
3 个回复
Uniapper开发者 - https://www.uniapper.com/(uni-app学习交流)
https://www.uniapp.club/
<swiper indicator-dots="true" autoplay="true" interval="3000" duration="1000" :style="{'height':windowHeight}">
<swiper-item>
<view class="swiper-item" :style="{'height':windowHeight,'background-color':'red'}">A</view>
</swiper-item>
<swiper-item>
<view class="swiper-item" :style="{'height':windowHeight,'background-color':'green'}">B</view>
</swiper-item>
<swiper-item>
<view class="swiper-item" :style="{'height':windowHeight,'background-color':'pink'}">C</view>
</swiper-item>
</swiper>
Uniapper开发者 - https://www.uniapper.com/(uni-app学习交流)
<script>
export default {
data() {
return {
windowHeight: '603px' //定义高度值变量
}
},
onLoad() {
}
}
</script>
8***@qq.com (作者)
先定义603? 够吗
2019-03-14 15:13
Uniapper开发者 - https://www.uniapper.com/(uni-app学习交流)
实际高度按照你的需要设置。用uni.getSystemInfo可以获取手机屏幕高度信息,这样就可以根据不同手机屏幕高度设置了