<input type="checkbox" name="switch" /> <!-- <input type="checkbox" name="switch" checked/> 默认启动 -->
<link href="https://cdn.bootcss.com/bootstrap-switch/4.0.0-alpha.1/css/bootstrap-switch.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/bootstrap-switch/4.0.0-alpha.1/js/bootstrap-switch.min.js"></script> $('[name="switch"]').bootstrapSwitch({ onText: "是", offText: "否", onColor: "success", offColor: "info", size: "small", // handleWidth: "30" })
js修改状态
$(this).bootstrapSwitch('state', data.cameras[index].isEnable == 1 ? true : false)
标签:30,false,bootstrapSwitch,bootstrap,offText,switch From: https://www.cnblogs.com/ljingjing/p/17005043.html