<wxml --片段>
<text class="{{current == 0?'cpoint':'point'}}"></text>
<text class="{{current == 1?'cpoint':'point'}}"></text>
<text class="{{current == 2?'cpoint':'point'}}"></text>
<js --片段>
data:current:0
var oldCurrent = this.data.current;
var newCurrent = (oldCurrent - 1) < 0 ? oldCurrent + 2 : oldCurrent - 1;
console.log(newCurrent);
this.setData({
current: newCurrent
})
问题:上面三个text标签在每次调用js里的方法之后只有类名发生改变的两个被添加上类名,在类名应该是point->point 时该标签没有添加上类名,问是什么原因,应该如何解决,求大神指点~
看上去没问题,能做个代码片段吗?
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
一模一样的代码贴在代码片段里就没有问题了,=_=这该怎么办
慢慢删减页面上的 html 和 js 呢。。或者对比
删到了和代码片段的一模一样,但是还是有问题
wechatide://minicode/G5tooGm27w1s
是不是 app.wxss里有啥样式有影响呢