这个setData该如何写?
<view class="item flex2">
<text class="content" style="-webkit-line-clamp:{{line}}" bindtap="more">{{content}}</text>
</view>
<view class="item flex2">
<text class="content" style="-webkit-line-clamp:{{line}}" bindtap="more">{{content}}</text>
</view>
Page({
data: {
line:'4'
},
more(e){
this.setData({
line:'15'
})
}
})
点击以后2个内容都显示15行了,该如何修改才是单独的效果?
3 回复
<view class="item flex2">
<text class="content" style="-webkit-line-clamp:{{line}}" bindtap="more">{{content}}</text>
</view>
<view class="item flex2">
<text class="content" style="-webkit-line-clamp:{{line1}}" bindtap="more1">{{content}}</text>
</view>
Page({
data: {
line:'4'
line1:'5'
},
more(e){
this.setData({
line:'15'
})
}
more1(e){
this.setData({
line1:'14'
})
}
})