<for=class=><type=name=class=/></>
上面的代码看上去没什么问题,但是点击时就发现问题了,这样会自动触发三次
+ () {
$().click(() {
console.log()
_this = $();
(_this.hasClass()) {
_this.removeClass();
_this.find().prop(, );
} {
_this.addClass();
_this.find().prop(, );
}
});
}();那么怎么解决呢?
方案一:for属性指向其他地方
<for=class=><type=name=class=/></>
方案二:label标签换掉,换成span或者其他的都可以解决
<class=><type=name=class=/></>
-
« 上一篇:
前端架构设计参考
-
angular.touch
:下一篇 »