Checkbox

原生复选框,支持不确定状态,通过字段与标签配对,适用于表单和“全选”列表。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 可用

用法

Partly read.

导入

ts
import {
  SoneCheckboxDirective,
} from "@surface-one/angular/checkbox";

API 参考

SoneCheckboxDirective指令

`input[soneCheckbox]` — the native checkbox (spartan/ui Checkbox, native first): it stays an `<input type="checkbox">`, so `[checked]`, `(change)`, `ngModel`, `formControl`, `required` and a `<label for>` all work as they do on any checkbox, and the global form styles draw it. The directive adds the mixed state the markup cannot express: `[(indeterminate)]`, cleared when the user toggles it.

选择器
input[soneCheckbox]
导出为
soneCheckbox
输入
名称类型 默认值
indeterminate双向

The mixed state ("some of them") — `[(indeterminate)]`; a click clears it.

booleanfalse