uni-app的scroll-view
<template>
<view class="j-scroll">
<!-- scroll-x是允许横向滚动 scroll-y是允许纵向滚动-->
<scroll-view scroll-x>
<!-- 这里面放内容-->
</scroll-view
</view>
</template>
<style scoped lang="scss">
.j-scroll {
width: 100%;
height: 400rpx;//横向要设置高度,纵向设置宽度
white-space: nowrap;
scroll-view {
}
}
具体属性详见:https://uniapp.dcloud.io/component/scroll-view
参考图: