var doBusiness = document.getElementById("do_business");
doBusiness.addEventListener("toggle",function(event){
if(event.detail.isActive){
mui.confirm('确认开始营业吗?','提示',['取消','确定'],function(){
});
console.log("你启动了开关");
}else{
console.log("你关闭了开关");
}
});
rooanlee
- 发布:2014-09-17 17:49
- 更新:2014-09-18 03:56
- 阅读:3730
3 个回复
rooanlee (作者)
来个人帮忙解决一下,实在被郁闷了
wy2949
.attr("value",1);
DCloud_UNI_FXY
{{{
document.getElementById('switch').addEventListener('toggle', function(event) {
if (!confirm('确认' + (event.detail.isActive ? '开启' : '关闭'))) {
this.classList.toggle('mui-active');
this.querySelector('.mui-switch-handle').setAttribute('style', '');
}
});
}}}