WeChat小程序交流(QQ群:769977169)
组件的多样式处理,是指不同状态下的样式,如未操作前的常规样式,点击高亮时的样式,选中状态下的样式。
如下效果图
代码示例
xxx.wxml
<text class='{
{item.selected ? "textSelectedStyle" : "textNormalStyle"}}'>{
{item.name}}</text>
xxx.wxss
.leftUIStyle .textNormalStyle{
width: 90%;
line-height: 44px;
padding-left: 10px;
font-size: 13px;
color: gray;
position: absolute;
}
.leftUIStyle