wxml
<view class='container'>
<scroll-view class='left-container' scroll-y style='height:{{screenHeight}}px'>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
<view class='shiren'>李白</view>
</scroll-view>
<scroll-view class='right-container' scroll-y style='height:{{screenHeight}}px'>
</scroll-view>
</view>
js
// pages/shici/ts/ts.js
Page({
/**
* 页面的初始数据
*/
data: {
screenHeight:300
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that=this;
wx.getSystemInfo({
success: function(res) {
console.log(res);
that.setData({
screenHeight:res.windowHeight
})
},
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})