微信 小程序布局 水平菜單
阿新 • • 發佈:2017-09-14
auto width wear mage logs log 技術分享 img pla
<!-- 菜單列表部分 -->
<view class="wear-menu">
<view class=‘menu-box‘ wx:key="menu" wx:for="{{menuList}}" wx:for-index="index">
<view class="menu-img" bindtap="selectMenu" data-index="{{index}}" data-id="{{item.id}}">
<image src=‘{{item.img}}‘></image>
</view>
<view class=‘menu-title‘>
<text>{{item.title}}</text>
</view>
</view>
</view>
//-----------------------------------------------------
/* 菜單列表部分 ***********/
.wear-menu{
display: flex;
}
.menu-box{
width: 33.33%;
}
.menu-img{
width: 150rpx;
height: 150rpx;
border-radius: 50%;
overflow: hidden;
margin: 0 auto;
}
.menu-img image{
width: 100%;
height: 100%;
}
.menu-title{
text-align: center;
}
//---------------------------------------------------------------
// 菜單列表部分
menuList:[
{ id: 1, img:"../../imgs/index/wear_1.png",title:"今日專場"},
{ id: 1, img: "../../imgs/index/wear_1.png", title: "補貨專區" },
{ id: 1,img: "../../imgs/index/wear_1.png", title: "特供專區" }
],
微信 小程序布局 水平菜單