uniapp横向滚动view-scroll
<scroll-view scroll-x="true">
<view class="scroll-view_W">
<view v-for="(item,index) in dataList" :key="index">
{{item.name}}
</view>
</view>
</scroll-view>
dataList:[
{
id:1,
name:'卧室',
temp:'23'
},
{
id:2,
name:'客厅',
temp:'25'
},
{
id:3,
name:'厨房',
temp:'27'
},
{
id:4,
name:'书房',
temp:'28'
}
]
<style>
.scroll-view_W{
width: 150%;
height: 100%;
display: flex;
flex-wrap: nowrap;
}
.scroll-view_W view{
width: 200upx;
height: 200upx;
border-radius: 50%;
margin-left: 20upx;
display: flex;
align-items: center;
justify-content: center;
background:rgba(255, 255, 255, 0.5);
}
</style>