html
{{item}}
wxss 部分
.scroll-box {
width: 100%;
height: 100rpx;
overflow: hidden;
background: #fff;
position: absolute;
top: 200rpx;
left: 0;
}
.scroll-view {
width: 100%;
height: 104rpx;
background: #fff;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
display: block;
box-sizing: border-box;
overflow-x: scroll;
}
.scroll-view::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.inline-view {
width: 200;
height: 104rpx;
line-height: 100rpx;
position: relative;
display: inline-block;
color: #0c8;
font-size: 32rpx;
padding: 0 32rpx;
}
js部分
const app = getApp()
Page({
data: {
width: 0,
height: 0,
list: [
‘是沓’,
‘是他’,
‘是他’,
‘是它’,
‘是她’,
‘是踏’,
‘是塌’,
‘是挞’,
‘是嗒’,
‘是拓’,
‘是塌’,
‘是铊’,
‘是遢’,
]
},
onLoad() {
this.setData({
width: wx.getSystemInfoSync().screenWidth,
height: wx.getSystemInfoSync().screenHeight
})
},
})