All files / src/checkbox/_example CheckboxControlledExample.jsx

100% Statements 1/1
100% Branches 0/0
100% Functions 1/1
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28        1x                                              
import React, { Fragment, useState } from "react";
import { Checkbox } from "@tencent/tea-component/lib/checkbox";
 
export default function CheckboxControlledExample() {
  return (
    <>
      <Checkbox display="block" value={false}>
        未选中
      </Checkbox>
      <Checkbox display="block" value>
        已选中
      </Checkbox>
      <Checkbox display="block" value={false} disabled>
        禁用未选中
      </Checkbox>
      <Checkbox display="block" value disabled>
        禁用已选中
      </Checkbox>
      <Checkbox display="block" indeterminate>
        半选状态
      </Checkbox>
      <Checkbox display="block" indeterminate disabled>
        半选状态已禁用
      </Checkbox>
    </>
  );
}