wxml:
<!--按钮-->
<view class="more" bindtap="showedit">{{editText}}</view>
<!--内容-->
<view class="delete {{editTrue?'isRuleShow':'isRuleHide'}}">
<image src='delete.png' mode="widthFix"></image>
</view>
wxss:
.isRuleShow {
opacity: 1;
}
.isRuleHide {
opacity: 0;
}
js:
Page({
data: {
editTrue: false,
showModalStatus: false,
editText: '编辑'
},
onLoad: function(options) {
},
// 编辑
showedit: function() {
var that = this;
if (that.data.editTrue == true) {
that.setData({
editTrue: false,
editText: '编辑'
})
} else {
that.setData({
editTrue: true,
editText: '完成',
})
}
},
})