CSS的一些常用样式,如背景、文字、文本、表格、列表等,以及一些常用的场景,如居中对齐、溢出、隐藏元素等。01、常用样式 1.1、background背景 设置元素背景的样式 background,更
2021-10-21 13:47:21
193
//wxml
<block wx:for="{{Listsimg}}" wx:key=\'unique\'>
<block wx:if="{{index == clickId}}">
<view class="img" style="border:{{border}};box-shadow:{{borders}}" id="{{index}}" bindtap="imgList" data-data="{{item}}">
<image src="{{item.imgList}}" />
</view>
</block>
<block wx:else>
<view class="img" id="{{index}}" bindtap="imgList" data-data="{{item}}">
<image src="{{item.imgList}}" />
</view>
</block>
</block>
//js
data: {
Listsumg: [
{
imgList: \'../../images/1.jpg\'
},
{
imgList: \'../../images/2.jpg\'
},
{
imgList: \'../../images/3.jpg\'
}
],
border:\'\',
clickId:\'\',
borders:\'\'
},
imgList:function(e){
console.log(this.data.imgLists[e.currentTarget.id])
this.setData({
border:"1rpx solid #eee",
borders:\'10rpx 10rpx 10rpx rgba(141, 161, 167, 0.9);\',
clickId:e.currentTarget.id
})
},
09
2022-11
30
2022-09
18
2022-09
15
2022-09
15
2022-09
15
2022-09