微信小程序 实现点击添加移除class

网友投稿 280 2023-05-08


微信小程序 实现点击添加移除class

微信小程序点击添加移除class类实现动态变化class

wxml:

北京

上海

wxss:

.location_bottom{height: 14http://0rpx;line-height: 140rpx;color: #d91f16;font-size:

28rpx;border-top: 2rpx #ebebeb solid; border-bottom: 2rpx #ebebeb solid; padding: 0 20rpx; align-items: center;display: -webkit-flex;}

.add_city{width: 228rpx;height: 60rpx;line-height: 60rpx; text-align: center; border: 2rpx

solid #ebebeb; color: #000000;margin-right: 20rpx; }

.add_citying{width: 228rpx;height: 60rpx;line-height: 60rpx; text-align: center;

border: 2rpx solid #09bb07; color: #09bb07;margin-right: 20rpx;}

js:

Page({

data: {

_num: 0,

},

clickNum: function (e)EaKNCAGUxg {

console.log(e.target.dataset.num)

this.setData({

_num: e.target.dataset.num

})

},

onLoad: function (options) {

}

})

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java中Socket下载一个文本文件
下一篇:Java concurrency之共享锁和ReentrantReadWriteLock_动力节点Java学院整理
相关文章

 发表评论

暂时没有评论,来抢沙发吧~