新增 checkbox 文档的半选示例

pull/1260/head^2
贤心 2023-05-25 22:44:36 +08:00
parent 3b59f5e29c
commit b3b8198fed
1 changed files with 14 additions and 1 deletions

View File

@ -18,7 +18,20 @@ toc: true
<input type="checkbox" name="AAA" title="默认"> <input type="checkbox" name="AAA" title="默认">
<input type="checkbox" name="BBB" lay-text="选中" checked> <input type="checkbox" name="BBB" lay-text="选中" checked>
<input type="checkbox" name="CCC" title="禁用" disabled> <input type="checkbox" name="CCC" title="禁用" disabled>
<input type="checkbox" name="DDD" title="半选" id="ID-checkbox-ind">
</div> </div>
<!-- import layui -->
<script>
layui.use(function(){
var form = layui.form;
var $ = layui.$;
// 初始设置半选
$('#ID-checkbox-ind').prop('indeterminate', true); // 半选属性只能动态设置
form.render('checkbox');
});
</script>
</textarea> </textarea>
</pre> </pre>