css:.v1 { width: 100rpx; height: 100rpx; background: red; border-radius: 50rpx;}
.v2 { width: 100rpx; height: 100rpx; background: gray; border-radius: 50rpx;}
js:
Page({data: { san: true, i: 1, //变量
},// 声明一个变量,并判断这个变量 selectList: function () { var that = this; console.log(that.data.i, "i") if (that.data.i == 1) { that.data.i = 2, that.setData({ san: false, }) } else { that.data.i = 1, that.setData({ san: true, }) } console.log(that.data.i, "i2222") },
})













